Java界面风格
作者:互联网
把下列代码,选择后,粘贴到public static void main(String[] arg){}里,主界面类的前面。
当然,前面也需要导入,
import javax.swing.UIManager;
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");//Nimbus风格,jdk6 update10版本以后的才会出现
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//当前系统风格
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");//Motif风格,是蓝黑
//UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());//跨平台的Java风格
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");//windows风格
//UIManager.setLookAndFeel("javax.swing.plaf.windows.WindowsLookAndFeel");//windows风格
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");//java风格
//UIManager.setLookAndFeel("com.apple.mrj.swing.MacLookAndFeel");//待考察,
} catch (Exception e) {
e.printStackTrace();
}
---------------------
作者:詹坤林
来源:CSDN
原文:https://blog.csdn.net/zklth/article/details/6279938
版权声明:本文为博主原创文章,转载请附上博文链接!
标签:Java,windows,界面风格,setLookAndFeel,swing,java,UIManager,plaf 来源: https://www.cnblogs.com/gfd1511/p/10971694.html