Saturday, January 5, 2013

How to get Windows 7 look and feel to your Java Application

When you developing Java Desktop Applications using Java Swing, it is very important to consider the look and feel of the Application. In this post I will give you the code segment for this task.
click on below links for more example codes.
 
In your Java Swing Application, you can add windows 7 look and feel by using below code.

try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

} catch (Exception e) {
}

 When you add this code to your Application, you need to import UIManager package.
                  import javax.swing.UIManager;
 Following figure is an example for Java application which contains Windows 7 look and feel.

 
Do not forget to leave your comments below.

No comments:

Post a Comment