Search code examples
javaswingintellij-idealook-and-feel

How to change look and feel of swing application in intellij idea


I am a student, I am using idea for my applications. I am working on swing form , I have done every thing but unable to change look and feel of my app.

I am using intellij idea community edition, can anyone tell me how I can change look and feel of my swing application?


Solution

  • To change look and feel in Java just add this to your main method before you create the GUI.

    try {
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");  // Windows Look and feel
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
        e.printStackTrace();
    }