11th March 2009

How to change the Netbeans IDE look and feel

Netbeans should default to using the look and feel of your operating system. If you want to force the IDE to use a different look and feel, there are two ways to do it. I'll cover both.

If you're looking to change the look and feel of your own applications, look here.

The Different Looks and Feels

Before I tell you how to change the look and feel, it'll help if you know what defaults are available.

Java (and by inheritance Netbeans) come with 2 or 3 themes you can use depending on your OS. They are:

Now you know what they're called, lets see what they look like.

Image showing the Metal look
      and feel Image showing the GTK look
      and feel Image showing the Motif look
      and feel Image showing the Windows look
      and feel

Now, how about getting Netbeans to use them? We're almost there. Each of the themes shown above has a "look and feel" object that you must reference to use the theme. Below are the class paths to those objects that you will use to set the look and feel.

Via the Command Line

Probably the easiest way to get Netbeans to use a different look and feel is via the command line. When launching Netbeans, you can append the '--laf' parameter to tell Netbeans to use a specific look and feel.

netbeans --laf com.sun.java.swing.plaf.windows.WindowsLookAndFeel

Windows users should right-click on the shortcut to Netbeans, select Properties and append the parameter to the 'Target' box.

Via the Config File

Netbeans has a configuration file within it's installation directory which can also be used to set the look and feel. Browse to where you installed Netbeans and open the file: etc/netbeans.conf

Find the line with 'netbeans_default_options=' and append the --laf parameter to the end:

netbeans_default_options="...--laf com.sun.java.swing.plaf.windows.WindowsLookAndFeel"

And that's how you make Netbeans look like a 1980's horror show.

Netbeans IDE using Motif look and feel, it looks ugly