• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

starting a new line of text

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oddly enough, each time through the same information is printed also, and the loop does not print.

Jen
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
reply
    Bookmark Topic Watch Topic
  • New Topic