Skip to main content

How does SwingX force text to render anti-aliased?

3 replies [Last post]
kennethorr
Offline
Joined: 2005-11-11
Points: 0

How does SwingX force text to render anti-aliased?

I'm using BasicGraphicUtils methods in order to draw text, and am thusly prevented from changing the anti-aliasing state of that text. I noticed that SwingX renders components with AA turned on even when the default is for no AA, so I figured checking in with this group would be a good starting point.

I saw this discussion here, http://forums.java.net/jive/thread.jspa?threadID=46948 , but I didn't see a resolution.

Thanks,
-Ken

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kleopatra

jdnc-interest@javadesktop.org schrieb:
> How does SwingX force text to render anti-aliased?
>
> I'm using BasicGraphicUtils methods in order to draw text, and am thusly prevented from changing the anti-aliasing state of that text. I noticed that SwingX renders components with AA turned on even when the default is for no AA, so I figured checking in with this group would be a good starting point.
>

Fact being that swingx does exactly nothing particular in regard to text
antialias :-) The one exception is JXLabel is goes hacky and got it
wrong (as noted in the thread you referenced).

As to the what-to-do in custom applications: would try to never draw
text directly but use a renderer-type approach with a JLabel. That way
you'll get the same antialias behaviour as core swing - for good or for
bad. Or if you insist to draw directly and have enough control about
your environment, you might travel the road as outlined by Kirill or
JGoodies (that is ultimately use sun's hidden classes).

Cheers
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

kennethorr
Offline
Joined: 2005-11-11
Points: 0

I guess no one knows the answer to this question?

kirillcool
Offline
Joined: 2004-11-17
Points: 0

You can find some of the implementation details if you follow your own link. One of the replies at that thread will point you to [1], specifically replies 7 and 25.

[1] http://www.javalobby.org/java/forums/t87243.html?start=0