Set windows look and feel in java swing application

Setting windows look and feel in a java swing application is easy.This article will explain with the required source code ,how to set windows look and feel for your java swing application.

Go to the class which has the main function. Comment the code for the existing look and feel and add the following code

try {
//javax.swing.UIManager.setLookAndFeel(""); //.getSystemLookAndFeelClassName());
//The following line of code invokes windows look and feel

            } catch (    ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
                  java.util.logging.Logger.getLogger(MainUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

That is all.

If you liked this article please do leave a reply and share it with friends.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.