OS X 上的 JFileChooser
JFileChooser 看起来与本机小部件完全不同。 我似乎记得读过一些黑客让它看起来像本机小部件,但搜索它知道我似乎无法再次找到它我遇到建议使用 java.awt.FileChooser 的帖子,但该类似乎不在分布。 我怎样才能使 JFileChooser 看起来像本机小部件?
JFileChooser looks nothing like the native widget. I seem to remember reading some hack to get it look like the native widget but searching for it know i can't seem to find it again i came across posts that suggest using java.awt.FileChooser but that class does not seem to be in the distribution. How can i make JFileChooser make look like the native widget?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
java.awt.FileDialog
将是帖子所指的类。 毫不奇怪,它比 Swing 版本受到更多限制。 所有 Java SE 实现都需要具有 FileDialog 类(尽管无头配置可能无法用它做任何有用的事情)。java.awt.FileDialog
will be the classes the posts meant. It is, unsurprisingly, more limited that the Swing version. All Java SE implementations are required to have theFileDialog
class (although headless configurations may not be able to do anything useful with it).请查看此页面。 它经历了很多 UI 调整,但第三个最相关:“使用 JFileChooser 获取 Mac 文件和文件夹图标。”
Take a look at this page. It goes through a lot of UI tweaks, but the third one is most relevant: "Using the JFileChooser to get Mac file and folder icons."
Quaqua 的外观和感觉可能值得一看,它用很多功能取代了文件选择器更好、更原生的版本,包括文件夹着色等。
It may be worth a look at the Quaqua look and feel, it replaces the file chooser with a much better and more native version, including folder colouring etc.