Java设计好看的窗体必加的代码(使用内置皮肤控件):
把以下代码加到主函数里面:
try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } catch (Exception e) { e.printStackTrace(); }
或者
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");