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 un开发者_C百科der 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.
try{UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
catch(Exception e){}
If you're using Swing, then this should work:
try {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
}
Read the secton from the Swing tutorial on How to Set the Look and Feel for information about setting/changing the LAF.
精彩评论