Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JLabel Clipping



JLabels on OSX 10.3 w/ Java 1.4.2_03-117.1 will often clip their text. The same exact code does not clip on 10.2 w/ Java 1.4.1_01-69.1. The problem is most likely in the FontMetrics.stringWidth method, as even if the JLabel is explicitly sized via:
JLabel label = new JLabel("some text");
label.setFont(newFont);
FontMetrics fm = label.getFontMetrics(label.getFont());
int width = fm.stringWidth(label.getText());
label.setPreferredSize(width, largeHeight);
the clipping will still occur.

Has anyone else noticed problems with JLabel's clipping text for no reason?

Thanks,
Sam
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.