Posted on 2010-02-28 10:04
asdtiang 閱讀(4664)
評論(0) 編輯 收藏 所屬分類:
JAVA
咋天有好友問了下swing皮膚包的問題,晚上學習了下,寫出來供大家參考。(以前沒玩過,不要笑)
http://javootoo.l2fprod.com/index.html 該網站上有收費和開源的皮膚包。
加載皮膚包的代碼在這里簡單說下,加入JAR包,在窗體加載代碼前加入以下代碼,窗體最好以線程啟動。
protected void startup() {
try {
UIManager.setLookAndFeel(new NapkinLookAndFeel());
///每個皮膚包都有一個****LookAndFeel類,查下文檔或看下JAR都能找到,在這里改下就可以了
} catch (UnsupportedLookAndFeelException ex) {
Logger.getLogger(TestSkin1View.class.getName()).log(Level.SEVERE, null, ex);
}
show(new TestSkin1View(this));
}
我的環境是NetBean6.8
代碼就不用多說了,來看下效果。substance有BUG,它不是完全開源的,不過它的皮膚包很多
Napkin Look & Feel
Liquid look & feel
idw-gpl
JTattoo
com.jtattoo.plaf.smart.SmartLookAndFeel

com.jtattoo.plaf.bernstein.BernsteinLookAndFeel
Squareness Look and Feel
net.beeger.squareness.SquarenessLookAndFeel
天蒼蒼,野茫茫,風吹草底見牛羊