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"