1

Is it possible to turn off ANTIALIAS in JLabel? Something like this (but it is not working..):

@Override
    public void paintComponent(Graphics g) {

        Graphics2D graphics2d = (Graphics2D) g;
        graphics2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
        super.paintComponent(g);
    }
}

Or should I create custom Label where I can easily set this ANTIALIAS value? The goal is to make the text not fuzzy.

Ernestas Gruodis
  • 8,567
  • 14
  • 55
  • 117
  • I don't know a lot about `synth` and the Swing L&F stuff, but maybe you can find an answer here: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/ – ControlAltDel Mar 12 '15 at 17:15
  • I'm crazy, and I always drawing components myself using only `JComponent`.. So Synth or L&F not needed. This time I thought it will be simple task, but I suspect that - again - I will create some XLabel :) – Ernestas Gruodis Mar 12 '15 at 17:18

1 Answers1

0

Found the solution (first lines when application starts):

System.setProperty("awt.useSystemAAFontSettings", "off");
System.setProperty("swing.aatext", "false");

Now everything is OK, I can see nice fonts on my Eizo ColorEdge display. My question - why the hell Windows OS uses all that blurred/fuzzy settings also... And almost impossible to switch off antialiasing.. Try to do that in Windows10 taskbar at the Desktop bottom.... Nightmare. It is hard to believe that someone could use it and say "it's OK" :) I believe the rivals are coming :)

Ernestas Gruodis
  • 8,567
  • 14
  • 55
  • 117