LookAndFeel in ALL apps

By | 16 Dec 2008

To set your favorite LAF in all Java apps, you can create a file swing.properties in your jre/lib1Windows: C:\Program Files\Java\jre1.6.0_01\lib
Linux: /usr/lib/jvm/java-6-sun/jre/lib
folder with following contents:

swing.laf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
swing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

You can also set the _JAVA_OPTIONS environment variable to the following (or just specify these parameters upon the java-call):

-Dswing.laf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

From now on you will see NimbusLookAndFeel in all Java applications which do not set a LAF on their own.

Available LookAndFeels as of 1.6:

  • com.sun.java.swing.plaf.gtk.GTKLookAndFeel
  • com.sun.java.swing.plaf.motif.MotifLookAndFeel
  • com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
  • com.sun.java.swing.plaf.windows.WindowsLookAndFeel
  • javax.swing.plaf.basic.BasicLookAndFeel
  • javax.swing.plaf.metal.MetalLookAndFeel
  • javax.swing.plaf.multi.MultiLookAndFeel
  • javax.swing.plaf.synth.SynthLookAndFeel
  • 1
    Windows: C:\Program Files\Java\jre1.6.0_01\lib
    Linux: /usr/lib/jvm/java-6-sun/jre/lib ↩︎

Leave a Reply

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

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.