Adding a new Swing look and feel

With the visual editor for Java, you can use a look and feel other than those provided by Swing.

If you develop your own look and feel, or download an open-source look and feel from javootoo.com, for example, you can add the look and feel to the visual editor.

To add a new Swing look and feel:

  1. Add the JAR file with your look and feel to the Java Build Path.

    1. Download or create a new look and feel and save to a local directory.

    2. Unzip to the Project directory where you want to include the new Look and Feel.

    3. In the Project Explorer, right-click the project name.

    4. Click Properties > Java Build Path > Libraries.

    5. Click Add External Jars and browse to the JAR file that contains the look and feel, then click OK. Now, you are ready to apply the new Look and Feel to your application.

  2. Add the look and feel to the visual editor preferences:

    1. Open the Preferences window by clicking Window > Preferences, and select Java > Visual Editor.

    2. Next to the Swing Look and Feel table on the Appearance tab, click New.

    3. Provide a Name and the Class for the new Look and Feel. The LookAndFeel class name should be in the documentation for the look and feel. If you cannot locate the look and feel class name, you can find the class name by right-clicking the .jar file you added to your project, and pressing F4 to open its hierarchy.

    4. Click OK to close the Look and Feel dialog.

  3. Select the check box next to the new look and feel.

  4. Click OK to save your preferences.

  5. Close your application, then open it again to see the new Look and Feel.

 

Parent topic

Working with Swing in the visual editor

 

Related tasks

Changing the Swing look and feel