Ahhh, excellent!  I knew there had to be an easier way.

tom

Ben Galbraith wrote:
On Aug 24, 2006, at 8:20 AM, Tom Welch wrote:
Many java applications if using swing tend to have really ugly UI's. The fonts look terrible.

I wrote some code that can make them look a whole lot better. This code requires jre 1.5.

If you're on JDK5, just set this system property:

swing.aatext=true

and Swing will use anti-aliasing throughout.

If you're not on JDK5, probably best to create your own look-and-feel that simply subclasses an existing look and adds anti-aliasing to the UI delegates.

j.putClientProperty(com.sun.java.swing.SwingUtilities2.AA_TEXT_PROPERTY_KEY,Boolean.TRUE);

Using com.sun.* classes is risky. For something as trivial as a constant, probably best to define the constant yourself and use it that way. With Apple in the fray as a popular JRE implementor, this problem is not theoretical, though I suspect this code would still work as they in practice do include a lot of Sun's impl. in their own.

Ben


_______________________________________________
Ldsoss mailing list
Ldsoss@lists.ldsoss.org
http://lists.ldsoss.org/mailman/listinfo/ldsoss


--
Tom Welch
[EMAIL PROTECTED]
(801) 240-1609
(858) 829-4614 - Cell


------------------------------------------------------------------------------


NOTICE: This email message is for the sole use of the
intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply email
and destroy all copies of the original message.

------------------------------------------------------------------------------

_______________________________________________
Ldsoss mailing list
Ldsoss@lists.ldsoss.org
http://lists.ldsoss.org/mailman/listinfo/ldsoss

Reply via email to