Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

new line inside a JLabel

807607Dec 13 2006 — edited Dec 13 2006
I know that this sounds like a noobie question but....
I created a JLabel that has a paragraph in it. When I run the program, it prints the paragraph in one line. How do I make it so I can insert new lines? Since this is a GUI, I can't use println. I've tried the following:

Code:

...
JLabel label = new JLabel("BLAH BLAH BLAH BLAH BLAH BLAH BLAH\n" +
"BLAH BLAH BLAH BLAH BLAH BLAH BLAH");
...
The "\n" doesn't work either. Help pl x?

--------------------------------------------------------------------------------
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2007
Added on Dec 13 2006
1 comment
754 views