TaT ChangingLookAndFeel

Tips and Tricks | Changing Look and Feel

Contributed By; Tushar Joshi


[[{TableOfContentsTitle=TableOfContents} | {TableOfContents title='Table of Contents'}]]


The default look and feel of the recently released NetBeans IDE 6.1 final is set automatically according to the operating system. This make the NetBeans appear as a Windows application with Windows look and feel while running on windows and so forth in other operating systems.

File:01. lnf-windows.png

I like the cross platform look of java applications which can be set by configuring the java applications with the Metal look and feel. NetBeans also allows us to change the default look and feel by a configuration setting.

Changing the Look and Feel


Ideally we would have loved to have a look and feel menu or a setting in the preferences dialog in the NetBeans IDE GUI to set the look and feel. The current way to change the default look and feel is either by changing the configuration file or passing a command line argument to the netbeans startup command.

We will use the configuration file setting method to change the default look and feel of NetBeans IDE. As this setting is a configuration setting we will have to pass the exact fully qualified name of the look and feel class we want.

In our case as we want metal look and feel we will use the name:

javax.swing.plaf.metal.MetalLookAndFeel

When default paths are chosen for the installation of NetBeans IDE it gets installed in

C:\Program Files\NetBeans 6.1

The configuration files are kept in a subdirectory named etc so the exact path for the netbeans.conf file is:

C:\Program Files\NetBeans 6.1\etc\netbeans.conf

When opened in text editor it will look like

File:02. netbeans-conf.png

Here we will change the netbeans_default_options portion and add one additional switch to the options line.

File:03. netbeans-conf02.png

File:04. netbeans-conf03.png

Cross Platform Look And Feel


File:05. lnf-metal.png

References:


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo