Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text Anti-aliasing

 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 5797
61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.setProperty("awt.useSystemAAFontSettings","on");
System.setProperty("swing.aatext", "true");

Add these lines at the start of your program, before anything is displayed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic