0

How can i continue a very long sentence on the second line in a JLabel?

/n does not work
/t does not work as well

I dont want the html thing cause i have a simple application.

Thank you

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by HelloMe
1

The only way I know is HTML, but that's really easy - eg
myJLabel.setText("<HTML><This is a test<BR>on two lines</HTML>");

Votes + Comments
straight to point with example
0

Ok i will try it... i let you know if i get it to work.

0

Thank you very much, thats the one i was looking for.

Do you know how to apply it with /t?

0

/t isn't going to do anything for you, you'll have to use HTML codes for formatting & layout. JLabels support many ordinary HTML tags, but not all. You just have to try a few things and see what works to give the result you need.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.