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/