问题
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.
回答1:
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 :)
来源:https://stackoverflow.com/questions/29016071/jlabel-is-it-possible-to-set-renderinghints-value-text-antialias-off