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!

JLabel resizing

814353Dec 5 2011 — edited Dec 5 2011
Hi

I have a JLabel inside a JPanel, when I resize the window JLabel is also getting resized. I don't want my JLabel to get resized.

I have a method which will add a Hyperlink look to the JLabel, I feel this is causing the JLabel to resize, as i don't see other JLabels getting resized.

if (label.getFont().isBold())
label.setText("<html><u><b><font color=\"#000000\" face=\"Dialog\">" + sOld + "</font></b></u></html>");
else
label.setText("<html><u><font color=\"#000000\" face=\"Dialog\">" + sOld + "</font></u></html>");

Dimension d = label.getPreferredSize();
label.setMinimumSize(d);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 2 2012
Added on Dec 5 2011
3 comments
299 views