让swing使用苹果风格的皮肤

来源:互联网 发布:java怎么下载安装 编辑:程序博客网 时间:2024/05/08 03:12

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

    

原创粉丝点击