JFilechooser的外观 [英] JFilechooser appearance

查看:95
本文介绍了JFilechooser的外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的swing应用程序中,我将UI外观设置为:

In my swing application, I have set the UI Look and Feel as:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

它在Windows上运行良好.在应用程序内部,用户必须使用JFileChooser选择文件. Windows上的JFileChooser外观也是本机外观.但不适用于Mac. JFileChooser面板的屏幕截图:

And it works well on Windows. Inside, the application, the user has to select files using the JFileChooser. The JFileChooser appearance on windows is again the native one. But not on Mac. The screenshot of the JFileChooser Panel:

但是,我更喜欢这样的东西:(这是从gmail的上载选项中提取的)

But instead, I prefer something like this: (This one is taken from upload option in gmail)

我应该将UIManager更改为其他什么吗?

What should I change the UIManager to or anything else??

推荐答案

以下几种替代方案:

  • java.awt.FileDialog,在此处说明.
  • java.awt.FileDialog, illustrated here.

  • 自定义ChooserUI,显示在此处.
  • A custom ChooserUI, shown here.

  • 完全定制的实现; 此处显示了几种变体.
  • A completely custom implementation; several variations are shown here.

这篇关于JFilechooser的外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆