java程序的皮肤效果实现代码

JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground","true");


先把这些加进去.然后再加:

javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme( new javax.swing.plaf.metal.DefaultMetalTheme());
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");


//以下是种常见的外观
lookAndFeel=UIManager.getCrossPlatformLookAndFeelClassName()//jdk6的外观
lookAndFeel=UIManager.getSystemLookAndFeelClassName();//当前系统的外观
lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
lookAndFeel ="javax.swing.plaf.metal.MetalLookAndFeel";
lookAndFeel="com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
lookAndFeel="com.sun.java.swing.plaf.motif.MotifLookAndFeel"

posted @ 2013-01-21 13:29  jack_ou  阅读(467)  评论(0编辑  收藏  举报