Linux 上 JFileChooser 的替代品?
我不喜欢 Linux 中这种丑陋的 FileChooser 布局。
此布局被任何其他布局使用程序,而且更加美观。
这种布局在 Java 中可用吗?如果是这样,怎么办?
I don't like this ugly FileChooser layout in Linux.
This layout is used by any other program and is MUCH more beautiful.
Is this layout available in Java? If so, how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更新:此项目致力于解决该问题。
我不相信这是重复的。其他问题中建议的解决方案对 Linux 中的情况没有帮助(至少是 GTK)。
FileDialog
看起来与JFileChooser
不同,但实际上同样奇怪。它看起来不像原生 GTK 应用程序的文件选择器。XFileDialog
仅适用于 Windows,并依赖 GTK 中的JFileChooser
。VFSJFileChooser
并没有以改进 GTK LAF 作为目标。不幸的是,我不知道有任何文件选择器在 GTK 中看起来是原生的。希望其他人也这样做。
Update: this project is dedicated to solving the problem.
I do not believe this is a duplicate. The suggested solutions in the other questions do not help the situation in Linux (GTK at least).
FileDialog
looks different thanJFileChooser
, but really just as strange. It does not look like the file choosers of native GTK applications.XFileDialog
is Windows-only and falls back onJFileChooser
in GTK.VFSJFileChooser
does not have improved GTK LAF as a goal.Unfortunately I do not know of any file chooser that looks native in GTK. Hopefully someone else does.
gtkjfilechooser 不适用于 JDK7 等较新的 JDK。此问题已于 2011 年报告,但尚未修复。
另一方面,AWT
FileDialog
已使用 Java 7 进行了改进 - 包括多个文件选择。检查链接的 JavaDoc 的 .
谈到 JDK7 的 FileDialog,这不再是事实了。现在,它看起来完全就像原生的一样。
顺便说一句,同样的问题也出现在 OS X 上,它的
JFileChooser
看起来也不太原生。 Apple 建议使用FileDialog
而不是JFileChooser
:(来源)
最后一句话似乎在 Linux 和 OS X 之间很常见(对于所有 *NIX?)。所以最后:
如果你不 对于
JFileChooser
有一个(功能性)原因,请使用 AWT 的FileDialog
代替。The gtkjfilechooser is not working with newer JDK's like JDK7. This was reported 2011, but is not fixed yet.
On the other side, the AWT
FileDialog
has been improved with Java 7 - including multiple file selection. Check linked JavaDoc for .Talking about FileDialog of JDK7, this is not true anymore. Now, it looks exactly like the native one.
Btw., the same issue occurs on OS X, the it's
JFileChooser
doesn't look very native too. Apple recommends the usage ofFileDialog
instead ofJFileChooser
:(Source)
Last sentence seems to be common (for all *NIX?) between Linux and OS X. So finally:
If you don't have a (functional) reason for
JFileChooser
, use AWT'sFileDialog
instead.