Specify the antialias property on the command line

I remember, not so long ago, someone posted a link on how to specify global rendering hints for using anti-aliases in java.

Sorry, I can not find the question.

How can I specify a rendering hint for using anti aliases in swing?

+4
source share
1 answer

For one Graphics2D:

Graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 

Call that on Graphics2D you draw and you will have anti-aliasing !!

For global settings:

 //this SHOULD enable global anti-aliasing System.setProperty("awt.useSystemAAFontSettings","on"); System.setProperty("swing.aatext", "true"); 

EDIT By oreyes:

The first did it !!!

alt text http://img35.imageshack.us/img35/4421/imagen1urb.png

vs.

alt text http://img169.imageshack.us/img169/4089/imagen2i.png

+5
source

All Articles