Changing java swing look and feel

February 17th, 2010 § 2 comments

To run, say, the wmqttSample java application using the gtk look and feel for swing:

  • java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -jar wmqttSample.jar

Thanks to Andy Piper.

Also, from http://seysayux.wordpress.com/2009/01/11/make-java-use-the-gtk-look-feel-on-linux/ :

First, you’ll have to locate the directory your JVM is residing in. Unless your distribution did some real weird things, it’s usually either /usr/lib/jvm/<version> or /usr/java/[<version>] . Wherever it might be located, i’ll use /usr/lib/jvm/jre-1.6.0_10/ for the examples.

Locate the file named /usr/lib/jvm/jre-1.6.0_10/lib/swing.properties. If it doesn’t exist, create it.

Put the following inside the file:

swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

§ 2 Responses to Changing java swing look and feel"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

What's this?

You are currently reading Changing java swing look and feel at atchoo.

meta