Mac 上目录的 JFileChooser:如何让它不那么糟糕?
Mac 上“仅目录”模式下的 JFileChooser 有两个严重的、严重的问题:
1) 您无法用它创建目录
2) 您无法切换驱动器
这对于我的安装程序应用程序来说是一个很大的问题。据我所知,Apple 没有提供解决此问题的方法,您甚至无法激活非本机目录选择器...因此唯一的选择是找到免费/开源的纯 Java 替换小部件。
有人知道其中一个吗?
The JFileChooser in "directories only" mode on the Mac has two serious, crippling problems:
1) You cannot create directories with it
2) You cannot switch drives
This is rather a huge problem for my installer app. As far as I can tell, Apple provides no way around this problem, you can't even activate the non-native directory chooser ... so the only alternative is to find a free/open source pure-Java replacement widget.
Does anybody know of one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 java.awt.FileDialog 怎么样?它显示本机文件选择器并允许创建新文件夹。
What about using java.awt.FileDialog? It shows a native file chooser and allows creating new folders.
JFileChooser可以查看外部驱动器。从根目录向下导航到 /Volumes,所有驱动器都列在那里。它并不优雅,但它有效...
http: //lists.apple.com/archives/java-dev///2008/Feb/msg00079.html
JFileChooser can see external drives. Navigate down from the root into /Volumes and all drives are listed there. It's not elegant, but it works...
http://lists.apple.com/archives/java-dev///2008/Feb/msg00079.html
我使用 JFileChooser 和 showDialog 方法,没有遇到问题。我可以创建目录和 sava 作为具有我喜欢的名称的文件。如果仅使用 showOpenDialog 方法则无法创建目录
I used JFileChooser with showDialog method and I did not have problem. I can create directories and sava as the file with the name that I like. If you use only showOpenDialog method you can not create directories
我发现有一个神奇的属性可以让 awt filepicker 做正确的事情:
我依稀记得以前在 OS X 10.4 上尝试过这个,但它不起作用,但现在我在 Leopard 上,它是的,所以我是一个快乐的露营者。
I discovered that there is a magic property you can set that makes the awt filepicker do the right thing:
I vaguely recall trying this before when I was on OS X 10.4 and it didn't work, but now I'm on Leopard and it does, so I'm a happy camper.