Ani*_*ram 38 java windows user-interface swing
我是Java编程的新手,想知道是否有可能在Java GUI应用程序中获得Windows本机外观.显然Swing不起作用.
ten*_*ica 68
使用以下内容:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
Run Code Online (Sandbox Code Playgroud)
Kum*_*tra 13
试试这个....
语法是:
UIManager.setLookAndFeel(PLAF); (Pluggable Look and Feel)
因此,您必须包含以下3行.
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
SwingUtilities.updateComponentTreeUI(frame);
updateComponentTreeUI(frame);
Run Code Online (Sandbox Code Playgroud)
SwingUtilities.updateComponentTreeUI(frame)用于在更改后刷新帧.
归档时间: |
|
查看次数: |
55966 次 |
最近记录: |