1,先使用UIManager.setLookAndFeel(String s)方法設定對應的外觀html
2,再使用SwingUtilities.updateComponentTreeUI(Component c)方法馬上更新應用java
// Metal風格 (默認) String lookAndFeel = "javax.swing.plaf.metal.MetalLookAndFeel"; UIManager.setLookAndFee(lookAndFeel); // Windows風格 String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; UIManager.setLookAndFee(lookAndFeel); // Windows Classic風格 String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"; UIManager.setLookAndFee(lookAndFeel); // Motif風格 String lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel"; UIManager.setLookAndFeel(lookAndFeel); // Mac風格 (須要在相關的操做系統上方可實現) String lookAndFeel = "com.sun.java.swing.plaf.mac.MacLookAndFeel"; UIManager.setLookAndFeel(lookAndFeel); // GTK風格 (須要在相關的操做系統上方可實現) String lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; UIManager.setLookAndFeel(lookAndFeel); // 可跨平臺的默認風格 String lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName(); UIManager.setLookAndFeel(lookAndFeel);
// 當前系統的風格 String lookAndFeel = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(lookAndFeel);
########## 優選 ##########git
Weblaf:很是讚的套件,界面現代、簡約。依賴包較少。 有開源也有商業協議,我的最喜歡的皮膚。
https://github.com/mgarin/weblafgithub
PgsLookAndFeel:界面簡約現代,Apache2開源協議
http://www.pagosoft.com/projects/pgslookandfeel/web
Seaglass:蠻美觀的UI,界面現代,是基於Java 7自帶皮膚Nimbus改進
https://github.com/khuxtable/seaglass/wikiwindows
beautyeye:國人開發的UI,界面現代
https://github.com/JackJiang2011/beautyeye安全
########## 中選 ##########oracle
Synthetica:較豐富的UI風格,但對中文字體的支持有問題。一半的皮膚免費,但其中一些較美觀的須要商業受權
http://www.javasoft.de/synthetica/themes/cors
Jtattoo:分GPL / LGPL / Apache三種協議,有開源也有商業版,我的較喜歡其中的Luna風格(提供直觀顯示其各類主題的效果,同時推薦下載其源碼學習各類控件的使用方法)
http://www.jtattoo.net/學習
----- 參考附件
Insubstantial:substance項目的分支項目
https://github.com/Insubstantial/insubstantial
Nimbus:Java SE 6 Update 10之後Oracle內置的皮膚,若是想安全穩定,選它沒錯了
http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html
########## 其餘 ##########
Quaqua:整的很像MAC OS的界面
http://www.randelshofer.ch/quaqua/index.html
Alloy:商業的,感受通常
http://lookandfeel.incors.com/
JGoodies:商業的,感受更通常
http://www.jgoodies.com/products/swing-suite/