This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Skipping lines in JTextArea

 
Adam Blais
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm adding multiple entries to a JTextArea using a for loop. I'm using the append() method to add, but everything ends up on the same line. How would I go about skipping to the next line after each entry?
 
Jeff Grant
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Append a "\n" after each entry in the for loop. If you would like to skip a line (double spaced), append "\n\n".
 
Adam Blais
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
Jeff Grant
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Problem, glad I could help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic