Home > Computers, Programming > Changing the Default Java Swing Appearance

Changing the Default Java Swing Appearance

September 24th, 2009 Leave a comment Go to comments

The other day, I was playing with ArgoUML at work for a little bit of research.

When it opened up, it had that god-awful “Metal” look that all Java programs get. I knew that it was possible to change the appearance of Swing object programmatically so that they can have a native appearance and wondered if it was possible to change the default appearance.

I realised this morning that I had seen ArgoUML, with a Windows appearance, in a screenshot on their website. That made me realise that it must be possible to change the default setting.

Cue quick googling session!

That turned up this somewhat unhelpful page from Sun. This page explains how to do it programmatically, but at the bottom explains how to change the default setting. Unfortunately, the instructions on how to change it are practically non-existant (along the lines of “change this setting in this file. Create the file if it doesn’t exist” – no explanation of what to change it to, what the format of the file should be, etc.)

Fortunately, it also links through to this Java utility (German original, Google Translation) which lets you change the setting.

I ran this, chose my default setting, saved the file into my $JAVA_HOME/lib directory and now it works!


Leads me to question why there isn’t some Java settings utility bundled with the JRE in the first place!

Another interesting thing about the Sun Java page I listed earlier is that it argues

The underlying question is: should a Java program look and feel native anyway? One of the great ideas behind Java has always been “write once, run anywhere.” Taking that into account, shouldn’t a Java program look and feel the same, regardless which platform it runs on? Wouldn’t it be desirable if all Java programs had the same appearance?

Err, I would say “No”. The majority of the time, a user expects an application to look and feel like all of the other applications on their system. The vast majority of computer users do not care if I have written a program in Java, C, C++, Delphi, D, whatever – they just want it to work – hell most computer users probably haven’t even heard of Java! So why force Java to look differently? Default it to look like every other application on their system.

Categories: Computers, Programming Tags: ,
  1. No comments yet.
  1. No trackbacks yet.