try{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
SwingUtilities.updateComponentTreeUI(this);
}catch(Exception e){
e.printStackTrace();
}考贝到JFrame构造函数的最后,实现三种界面感官
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
SwingUtilities.updateComponentTreeUI(this);
}catch(Exception e){
e.printStackTrace();
}考贝到JFrame构造函数的最后,实现三种界面感官
提示
cannot access UIManager
既然已经import java.swing.*;应该不会出现这样的提示。
上面三种L&F都是默认存在的。
把代码贴出来looklook。