2009年12月18日 星期五

使用 jgoodies 的 look and feel

jgoodies 有許多產品,下載最新版的 jgoodies libraries looks 就可以了,
目前使用 2.2.2 版,將 looks-2.2.2.jar 加到 classpath 下
在執行到 swing 的任何程式之前,先加入以下 code 設定 L&F (look and feel)


// 設定銀色主題,有多種可用,必須在設定 L&F 前設定
// com.jgoodies.looks.plastic.theme - 主題的 package
PlasticLookAndFeel.setPlasticTheme(new Silver());
// 設定 look and feel ,在 linux 下使用 Plastic 系列比較沒問題,三種可用
//com.jgoodies.looks.plastic.PlasticLookAndFeel
//com.jgoodies.looks.plastic.Plastic3DLookAndFeel
//com.jgoodies.looks.plastic.PlasticXPLookAndFeel
UIManager.setLookAndFeel(new PlasticXPLookAndFeel());

沒有留言: