从6u10开始内置到JRE中了,可以在UIManager中通过调用 com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel 或 javax.swing.plaf.nimbus.NimbusLookAndFeel 名称打开。
再看看NetBeans的界面吧:
感叹,用户体验好了很多,看来Swing越来越有前途啦!
P.S. 官方给出了一段这样设置皮肤的代码:
import javax.swing.UIManager.*;
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
// If Nimbus is not available, you can set the GUI to another look and feel.
}