Better looking Java Apps

November 13, 2003

One of the annoying things about GUI applications written in Java is that they do not conform at all the the Operating System's look and feel. As a result Java applications not only feel slow, but also look like an application that you should run on Windows 95. I fault Sun for not doing a better job with Java's default look and feel on Windows (The look and feel on Mac OSX is very nice, which is one reason I suppose many Java Developers prefer Mac's). I've heard that Java 1.5 will have an updated look and feel, I'm looking forward to that.

I noticed today that there is a class called SystemColor in the java.awt package (so it has been around since Java 1, yet no one uses it). The class has static fields that define things like the System window color, control color, select color, tool tip color, desktop color, shadows, etc. So for example if you have some Component all you need to do to make it show up with the proper color is the following:

component.setBackground( SystemColor.control );

I tested this on Windows XP, and it shows up in XP's tanish window color, which looks much better than the dark silver color that Java defaults to!

5 people found this page useful, what do you think?


GUI applications work great in Java. A perfect example is Eclipse. I would find it hard to imagine an Eclipse user "feeling" some difference between it and a native application. With Java Swing the same can be said when the developer uses the native LAF. Of course, one should also take a look at Project Looking Glass from sun, which is one of the most beautiful windowing systems around and is quite snappy.
Matt, Eclipse doesn't use Swing, it uses SWT (the Standard Widget Toolkit) SWT makes JNI calls to native OS widgets, which is why eclipse is so much faster, and feels more like a native OS Application.
I‘‘m a big fan of SWT - if I do a Java application that requires a GUI, I always use SWT instead of Swing. I think the end user experience is much better, in that the person doesn‘‘t even know they‘‘re using a Java application.
I never stated that Eclipse uses Swing. I am perfectly aware of SWT, see my article on the subject. However, Java Swing can be implemented such that it uses the native OS widgets. This is how Java Swing works on Mac OS X for example.
Sorry Matt, I misread your post... Basically what I'm getting at, is I'd like to see a JVM like the Apple/Sun JVM on OSX on Windows.

Post a Comment


Spell Checker by Foundeo

Recent Entries


did you hack my cf?