Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Skipping lines in JTextArea  RSS feed

 
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
Boost this thread!