Windows 7外观和感觉JFileChooser

时间:2014-11-06 19:57:42

标签: java windows swing

我无法让我的JFileChooser看起来像Windows 7文件选择器对话框。我正在使用Java 7。

我想要的是什么:

enter image description here

我得到了什么: enter image description here

我的应用在打开任何Swing窗口之前在main方法中设置外观:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

我尝试手动为JFileChooser分配Windows外观类但没有成功:

JFileChooser fileChooser = new JFileChooser();
WindowsFileChooserUI wui = new WindowsFileChooserUI(fileChooser);
wui.installUI(fileChooser);

我也尝试通过命令行中的系统属性设置外观,但这也无济于事。

-Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel

有什么想法吗?感谢。

0 个答案:

没有答案
相关问题