Multiline JLabel

A

acamposr

Hi, I want to use a JLabel but I want it to be shown in several lines.
Otherwise the JDialog is very very wide when the text is long.

How can I do that?
 
V

Vova Reznik

Hi, I want to use a JLabel but I want it to be shown in several lines.
Otherwise the JDialog is very very wide when the text is long.

How can I do that?

Use html:

label.setText("<HTML>Line1<BR>Line2</HTML>");
 
A

acamposr

Use html:
label.setText("<HTML>Line1<BR>Line2</HTML>");

But I want it to be transparent for the user. For example:

new MyDialog(myText);

I want the dialog to be displayed with text in several lines without
the user typing all that HTML code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top