关于NetBeans的界面风格转换详细操作

 一 NetBeans界面风格的设置
            1.准备提供界面风格即LookAndFeel的包,这里选择JTattoo.jar这个风格包,里面差不多有十一个LookAndFeel
                这里先给出里面一个LookAndFeel类的列表:

            com.jtattoo.plaf.noire.NoireLookAndFeel
            com.jtattoo.plaf.smart.SmartLookAndFeel
            com.jtattoo.plaf.mint.MintLookAndFeel
            com.jtattoo.plaf.mcwin.McWinLookAndFeel
            com.jtattoo.plaf.luna.LunaLookAndFeel
            com.jtattoo.plaf.hifi.HiFiLookAndFeel
            com.jtattoo.plaf.fast.FastLookAndFeel
            com.jtattoo.plaf.bernstein.BernsteinLookAndFeel
            com.jtattoo.plaf.aluminium.AluminiumLookAndFeel
            com.jtattoo.plaf.aero.AeroLookAndFeel
            com.jtattoo.plafacryl.AcrylLookAndFeel

            2.到安装NetBeans的文件夹下找到启动参数配置文件 etc \ netbeans.conf  找到netbeans_default_options该项
                直接在该项的后面加上-cp:p F:\JTattoo.jar --laf com.jtattoo.plaf.noire.NoireLookAndFeel  我的JTattoo.jar包
                是放在F盘下的,可自行设置
                然后启动NetBeans就OK了!
                看看效果:
            

                OK界面很酷,还可尝试其它的LookAndFeel风格。
                另外也可以用另外一个风格包quaqua.jar是MAC外观风格-cp:p F:\quaqua.jar --laf  ch.randelshofer.quaqua.QuaquaLookAndFeel 
                效果为:
           

 二 程序运行时的界面风格
               虽然NetBeans界面风格变换了,但当编写的程序运行时依然是原来的操作系统的默认风格,并没有改变。
                这里可以通过引用javax.swing.UIManager包来改变程序运行的界面
                具体为          
                            //这里为前面quaqua.jar包里的QuaquaLookAndFeel类,必须先导入到项目类库中
                                         try {
                                                   UIManager.setLookAndFeel(new QuaquaLookAndFeel());

                                            } catch (UnsupportedLookAndFeelException ex) {}
                OK,还可以设置其它的LookAndFeel,只需导入相对应的包就行了。

                不过有个问题 在NetBeans下运行时有异常抛出,不过可照常运行,打包生成jar包后运行无误,风格当然是你想要的了。 
                JTattoo.jar quaqua.jar下载
posted on 2008-12-12 12:15 戴圣 阅读(4135) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: