>> So what he's saying here is that through a simple command-line option
>> we have anti-aliasing? That would be really cool, however, I searched
[quoted text clipped - 9 lines]
>
> Christian
This is also, apparently, an "undocumented" feature that was added for
testing only. Sun has said it could disappear in the future. I wouldn't get
too dependent on it.

Signature
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com
> java -Dswing.aatext=true Main
Thank you for your suggestion. The JVM is accepting -Dswing.aatext=true
as a valid option, however, it does not appear to do anything, all my
Swing components still render the same. Also, from what Bill said, it
seems like it's not something to use in production code.
At the moment I'm having to override paintComponent for every Swing
component I use to get anti-aliasing working:
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
super.paintComponent(g2d);
}
Is this really the only way to get anti-aliasing in Swing at the moment
(using 1.4.2), or is there a more elegant way that someone knows of?
Thanks, Jonck
Bill Tschumy - 26 May 2005 22:15 GMT
>> java -Dswing.aatext=true Main
>
> Thank you for your suggestion. The JVM is accepting -Dswing.aatext=true
> as a valid option, however, it does not appear to do anything, all my
> Swing components still render the same. Also, from what Bill said, it
> seems like it's not something to use in production code.
<snip>
> Is this really the only way to get anti-aliasing in Swing at the moment
> (using 1.4.2), or is there a more elegant way that someone knows of?
>
> Thanks, Jonck
If you are using 1.4.2, that is the reason the "aatext" hack doesn't work
for you. This is a 1.5 feature.

Signature
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com
Boudewijn Dijkstra - 26 May 2005 22:25 GMT
>> java -Dswing.aatext=true Main
>
[quoted text clipped - 15 lines]
> Is this really the only way to get anti-aliasing in Swing at the moment
> (using 1.4.2), or is there a more elegant way that someone knows of?
There is a mechanism that provides the Graphics objects to these
paintComponent methods. Maybe you can intercept the object before it is
passed to the method, giving you the opportunity to set a few default hints.
Richard Wheeldon - 27 May 2005 20:27 GMT
> At the moment I'm having to override paintComponent for every Swing
> component I use to get anti-aliasing working:
> Is this really the only way to get anti-aliasing in Swing at the moment
> (using 1.4.2), or is there a more elegant way that someone knows of?
WrapLF is slightly more elegant. It basically automates the
above process using a custom look and feel.
http://wraplf.l2fprod.com/
Richard
jonck@vanderkogel.net - 30 May 2005 17:49 GMT
Thanks for the comments guys.
The wraplf project seems a smart way of doing things, though I spotted
a lot of errors right away trying to use it in conjunction with the
JGoodies L&F.
So I guess I'll stick to the manual setting of rendering hints untill
Java 1.5 comes to OS X.
Kind regards, Jonck