String laf = "javax.swing.plaf.metal.MetalLookAndFeel";try {
    UIManager.setLookAndFeel(laf);
} catch (Exception e) { }

解决方案 »

  1.   

    插入到程序界面载入前比如 main() 方法里最前面
      

  2.   

    import javax.swing.*;
    import java.awt.*;
    public class JFrameTest extends JFrame{ public JFrameTest (){
    super("这是一个测试程序!");
    setBounds(200,200,200,200);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    show();
    }

    public static void main(String args[]){
    try{
    /*设置LookAndFeel*/
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
    /*也可以设置为下列的LookAndFeel*/
    //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
    }
    catch(ClassNotFoundException e){
    e.printStackTrace();
    }
    catch(InstantiationException e){

    e.printStackTrace();
    }
    catch(IllegalAccessException e){
    e.printStackTrace();
    }
    catch(UnsupportedLookAndFeelException e){
    e.printStackTrace();
    }
    JFrameTest test=new JFrameTest();


    }
    }