• Post Reply Bookmark Topic Watch Topic
  • New Topic

Formatting Label

 
Nicolas Viollin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a kind of Error MessageBox, and then to split the error message when it's size more than the MessageBox' size. the Error message is set in a label, so i need to split the text into the label, but i don't know how to do this, i've tried by adding the "\r" and "\n" characters, but they're displayed instead of being used.
Any suggestions ??
thnx
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use {html} and the br tag to do this. There is another post showing exactly how to do this from a week or so ago.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nicolas,
I think it can only be done using Swing JLabel.
JLabel my_label = new JLabel("< html >line 1 < br >line 2< br >line 3< / html >");

The line above gives you the idea. Remove the spaces for it to work correctly. If I didn't add the spaces you wouldn't see the HTML code correctly in this post.
Regards,
Manfred.
 
Nicolas Viollin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for your quick answers, but the problem is that i can only use awt controls ..... :-(
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!