Search code examples
javaswinguser-interfacenetbeanslook-and-feel

NetBeans: How to change the look and feel with respect to Operating System


I developed a small desktop application in Netbeans using Java. The application is working as expected. I developed it under WIN7.

When i run it on Microsoft Windows, the look and feel of UI is similar to Win XP Metal theme and when i run it on MAC it shows me the same theme. I want to change that theme with respect to operating system. Right now the theme is ok for windows i am looking for solution on MAC.


Solution

  • try{UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    catch(Exception e){}