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!

GridBagLayout and JLabels with resizing text

803011Oct 4 2010 — edited Nov 3 2010
I want to have my JLabels resize their text to as large a size as the JLabel can fit. In a GridBagLayout(GBL), changing the font size, changes the label's preferred size, causing the GBL to lay them out again, creating a loop.

Is there an easy way to extend/override something to solve this problem nicely? Or should I not be using this combination for some reason?
This post has been answered by camickr on Oct 4 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2010
Added on Oct 4 2010
12 comments
2,297 views