Skip to Main Content

Java SE (Java Platform, Standard Edition)

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!

Hi, how to wrap long Text string in JLabel ??

sunnycodeApr 11 2007 — edited Apr 12 2007
Dear Sir:

I found another problem, My JLabel text String is too long such as "This is a great American Cat", so my Jlabel size I set 60,60;
so When I run, I can only see words "This is a." and I cannot see remaining, I hope this text string can be separated autamitically by several lines and display like following:

IconImage

This is a
great
American
Cat

not a single line only show partial of whole sentence.
i.e
how to wrap long Text string in JLabel ??

Not sure guru can throw any light on this ??
Thanks again.

sunny
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2007
Added on Apr 11 2007
9 comments
1,227 views