Archive

Posts Tagged ‘look and feel’

Setting the JAVA Look and Feel

October 17, 2008 2 comments

The following code should be contained in the main method fo the main class.

You DO NOT need to set the look and feel of ever swing class in your project.

The look and feel in the main method provides scope accress all swing classes of the application.

Add the following import for the UI Manager.

import javax.swing.UIManager;

Add the following code at the top of the main method in the main class.
This will set the look and feel of the current platform.

try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
    System.out.println(“Error setting native LAF: ” + e);
}

Categories: Java Tags: ,
Follow

Get every new post delivered to your Inbox.