Java 6 and Swing on Linux

Bryan Sant bryan.sant at
Mon Nov 20 11:07:38 MST 2006

On 11/18/06, Michael Torrie <torriem at> wrote:
> Well I just installed FC6 and thought I may as well install the latest
> JDK.  So I grabbed Java 6 beta.  Seems to work well.  I recall a while
> back that it was said Swing would be sufficiently integrated with the
> GTK theme engine so as to make using SWT obsolete (at least on linux).
> Well I can say after just playing with the swingset demo that GTK
> integration is very poor.  About 75-85% of the theming cues are properly
> picked up, but other things like fonts are not at all.  So hopefully Sun

Fonts won't be fixed in Java 6.  I have a bug open with Sun.  Swing
fonts are rendered with a pure-Java routine.  True GTK+ fonts are
rendered with pango.  Java 7 will delegate to pango for font rendering
on Linux.

In the mean time, they have improved the rendering of Java 6 fonts to
be much closer to their native counterparts.  They are off, but I
personally doubt that the lay-user would notice at all.

> can fix this before the real release as right now swing apps look like
> there are trying to imitate GTK, but not well enough to really look or
> feel integrated into the GTK world.  Anyway. Just an observation.
> Hopefully it will get better soon.  In the meantime, SWT's place as the
> most-integrated GUI toolkit (as much as SWT sucks architecturally) is
> fairly safe on Linux.

I don't mind SWT's API or the architecture per se.  What I don't like
about it is, 1) it doesn't come with the JDK by default (so you get an
extra 3 - 4MB to download with your app), and SWT doesn't have a sweet
GUI builder like the one that exists for Swing in NetBeans.  Eclipse
has an SWT GUI builder plugin, but it is pretty sorry compared to

Other than fonts did you find anything else in the GTK emulation that was off?


More information about the PLUG mailing list