Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JLabel multiline text

 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a doubt regarding JLabel,i want to show the text in 2 lines
using JLabel, that means multiline text.i have some web services methods
and if i call that methods that text will store in JLabel,if that methods
containing large text,i was storing only small amount of text and
remaining text could be not shown in single line,now i want to implement
in multiline text using lbl.setMaximumSize() method,but this is not
working.please provide me any solution regarding this issue.

Thank you in advance

raja ramesh
 
Melki Joe
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try using html tags fot the text to be shown in JLabel. So that the <br> tag will help for next line.
 
Campbell Ritchie
Sheriff
Posts: 48445
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if the text is too long, try wrapping the JLabel in a JScrollPane.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic