1.先倒入jar包,quaqua.jar
2.JFrame.setDefaultLookAndFeelDecorated(true);
try{
UIManager.setLookAndFeel("ch.randelshofer.quaqua.QuaquaLookAndFeel");
} catch(Exception e){
e.printStackTrace();
}
3.但是在windows下会出现
Warning: ch.randelshofer.quaqua.util.Preferences failed to load Mac OS X global system preferences
java.io.FileNotFoundException: C:/Documents and Settings/new/Library/Preferences/.GlobalPreferences.plist (系统找不到指定的路径。)
因为quaqua,只工作在MacOS上,所以在windows上会出现这个问题,但基本不影响使用。
4.有一篇破解文章:http://hipo1983.blog.163.com/blog/#pn2
本文介绍了如何使Java Swing应用程序在Windows环境下采用苹果风格的皮肤。通过引入quaqua.jar库并设置LookAndFeel,可以实现这一效果。虽然在Windows上运行时会出现警告,由于quaqua库主要为Mac OS设计,但警告并不影响基本功能。解决这个问题的文章链接已提供。

287

被折叠的 条评论
为什么被折叠?



