views:

747

answers:

2

How can I turn off anti-aliasing for one specific JLabel? It uses a very small font which might look better without anti-aliasing.

If important, I'm using Java 1.5 on Mac OS X.

+1  A: 

I think you'll have to override the paint(Graphics g) method and draw the text yourself.

Richie_W
+2  A: 

Have you tried overriding paint(Graphics g) or paintComponent(Graphics g), setting rendering hints for text AA on the graphics object and calling the super method?

see RenderingHints: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/RenderingHints.html#VALUE_TEXT_ANTIALIAS_OFF

Somatik