The moose likes Swing / AWT / SWT and the fly likes Text Anti-aliasing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Text Anti-aliasing" Watch "Text Anti-aliasing" New topic
Author

Text Anti-aliasing

Isaac Hewitt
Ranch Hand

Joined: Jul 24, 2006
Posts: 191

I am using Java 6 update 22, on duo processor Windows 7. I have researched how to render all text in my program anti-aliased and have found all sorts of things on the Internet. I want to be able to have smooth text for every component without having to subclass them and adding



I have tried -Dswing.aatext=true in the NetBeans project properties box, but the text in the JLabel still looks jagged.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3905
    
  18

System.setProperty("awt.useSystemAAFontSettings","on");
System.setProperty("swing.aatext", "true");

Add these lines at the start of your program, before anything is displayed.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
jQuery in Action, 3rd edition
 
subject: Text Anti-aliasing
 
It's not a secret anymore!