Setting the Default Look and Feel Using a System Property or Property File

By default, Swing uses a cross-platform look and feel called Metal. This default can be changed with a system property on the command line, an entry in a properties file, or programmatically (see Getting and Setting a Look and Feel).

The following example demonstrates how to set the look and feel using a system property on the command line:

> java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel MyApp
Alternatively, the default look and feel can be set in a properties file called `swing.properties' located in the `<JAVAHOME>/lib' directory. The name of the property is swing.defaultlaf.
# Specify the default look and feel swing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.