首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

java 窗口怎么美化

2012-02-03 
java 窗口如何美化这个是我用java SWT开发工具,窗口界面用的是shell控件,可是太不好看了怎么才能将窗口美

java 窗口如何美化

这个是我用java SWT开发工具,窗口界面用的是shell控件,可是太不好看了

怎么才能将窗口美化一下做到像第二张图片这样呢,现在QQ什么的聊天工具都是这种风格,是怎么做到的?

[解决办法]
可以设置LookAndFeel,通过第三方皮肤:
可选使用substance、JTattoo、liquidlnf等,我当前使用的是JTattoo的皮肤,swing/awt的默认皮肤确实是有点那个...LZ可以去G一下上述皮肤,你会发现你的界面会很NICE的.
如下代码是我使用JTattoo的SmartLookAndFeel主题皮肤的方法,GoodLuck!

Java code
public static void main(String[] args) {                JFrame.setDefaultLookAndFeelDecorated(true);         JDialog.setDefaultLookAndFeelDecorated(true);        try {            SmartLookAndFeel.setTheme("Green");            SmartLookAndFeel lookFeel = new SmartLookAndFeel();            javax.swing.UIManager.setLookAndFeel(lookFeel);        } catch (Exception e) {            e.printStackTrace();        }        java.awt.EventQueue.invokeLater(new Runnable() {            public void run() {                new ToolMainFrame().setVisible(true);            }        });    } 

热点排行