• Post Reply Bookmark Topic Watch Topic
  • New Topic

starting a new line of text  RSS feed

 
Jen Wren
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all

In my code (which finally works thanks so much) I am trying to get the text to print to the next line each time it goes through the loop. I have tried to add \n, "\n", and "\n\n" to the end of the append line (after actInt) as well as add all three to the beginning of the line (before loop). When I add any of these the calculate button does not work, when I take them out the text prints all on about 4 lines instead of 80 lines. Any ideas?

Here is the section of code:

StringBuffer money = new StringBuffer();
for (int loop = 1; loop <= t; loop ++){
money.append(loop + monthly + balance + actInt);
future.setText(money.toString());
repaint();
}
 
Jen Wren
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oddly enough, each time through the same information is printed also, and the loop does not print.

Jen
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!