Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

swing display wrapped text  RSS feed

 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm simply trying to put a neatly-wrapped, un-editable block of text on a Swing application but I'm not finding a simple solution.

I tried a label but I can't figure out how to make the text wrap. I tried a textbox but I get scrollbars and I get line-breaks within the words rather than a neat break.

Should I be using a label? How do I do a line-break?

Thanks!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you have a lot of text, perhaps an uneditable JTextArea with word and wrap style set.
for just a snall text, perhaps a JLabel wrapped in <html> tags, and you place the <br> tags

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!