// Metal风格(默认) String lookAndFeel ="javax.swing.plaf.metal.MetalLookAndFeel"; // Windows风格 String lookAndFeel ="com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; // Windows Classic风格 String lookAndFeel ="com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"; // Motif风格 String lookAndFeel ="com.sun.java.swing.plaf.motif.MotifLookAndFeel"; // Mac风格 (需要在相关的操作系统上方可实现) String lookAndFeel ="com.sun.java.swing.plaf.mac.MacLookAndFeel"; // GTK风格 (需要在相关的操作系统上方可实现) String lookAndFeel ="com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; // 可跨平台的默认风格 String lookAndFeel =UIManager.getCrossPlatformLookAndFeelClassName(); // 当前系统的风格 String lookAndFeel =UIManager.getSystemLookAndFeelClassName();
选择一种界面风格后调用
!必须使用try - catch 环绕
try { UIManager.setLookAndFeel(lookAndFeel); } catch (Exception e) { e.printStackTrace(); }
JFrame.setDefaultLookAndFeelDecorated(true);
!需要写在调用JFrame及其子类构造方法之前
https://blog.csdn.net/u010995220/article/details/49847307
https://blog.csdn.net/evilcry2012/article/details/43669209
本文作者:双份浓缩馥芮白
原文链接:https://www.cnblogs.com/Flat-White/p/14797612.html
版权所有,如需转载请注明出处。