我是 Java 编程新手,想知道是否可以在 Java GUI 应用程序中获得 Windows 原生外观。显然 Swing 是行不通的。
问问题
66840 次
3 回答
16
试试这个....
语法是:
UIManager.setLookAndFeel(PLAF); (Pluggable Look and Feel)
因此,您必须包括以下 3 行。
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
SwingUtilities.updateComponentTreeUI(frame);
updateComponentTreeUI(frame);
SwingUtilities.updateComponentTreeUI(frame)用于在更改后刷新框架。
于 2012-07-11T04:26:49.037 回答
-3
试试这个代码:
javax.swing.UIManager.setLookAndFeel("Windows")
于 2012-07-11T03:31:16.903 回答