简体   繁体   English

如何本地化JavaFX FileChooser对话框?

[英]How to localize JavaFX FileChooser dialog?

Is there an option to localize JavaFX FileChooser dialog? 是否有本地化JavaFX FileChooser对话框的选项? In Swing JFileChooser localization was pretty simple (over UIManager ). 在Swing中,JFileChooser的本地化非常简单(通过UIManager )。 But i can't find similar functionality in JavaFX. 但是我在JavaFX中找不到类似的功能。

I don't think you can. 我认为你不能。 From the FileChooser Javadocs : FileChooser Javadocs中

Provides support for standard platform file dialogs. 提供对标准平台文件对话框的支持。 These dialogs have look and feel of the platform UI components which is independent of JavaFX. 这些对话框具有独立于JavaFX的平台UI组件的外观。

Since these are native File Chooser dialogs, the text displayed in them will be controlled by the locale of the platform (ie the regional settings chosen on the user's machine at the OS level). 由于这些是本机“文件选择器”对话框,因此其中显示的文本将由平台的语言环境控制(即,在操作系统级别上在用户计算机上选择的区域设置)。 Note that this is probably what you want anyway, as the user likely has these set the way they want. 请注意,无论如何,这可能都是您想要的,因为用户可能已经按照自己的方式设置了它们。 You could experiment with changing your regional settings and seeing if it changes the file chooser. 您可以尝试更改区域设置并查看它是否会更改文件选择器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM