如何本地化JavaFX FileChooser对话框? [英] How to localize JavaFX FileChooser dialog?

查看:160
本文介绍了如何本地化JavaFX FileChooser对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有选项可以本地化JavaFX FileChooser对话框?
在Swing中,JFileChooser本地化非常简单(超过 UIManager )。
但我在JavaFX中找不到类似的功能。

Is there an option to localize JavaFX FileChooser dialog? In Swing JFileChooser localization was pretty simple (over UIManager). But i can't find similar functionality in JavaFX.

推荐答案

我认为你不能。来自 FileChooser Javadocs

I don't think you can. From the FileChooser Javadocs:


提供对标准平台文件对话框的支持。这些对话框
具有平台UI组件的外观和感觉,它独立于JavaFX

Provides support for standard platform file dialogs. These dialogs have look and feel of the platform UI components which is independent of JavaFX.

因为这些是本机文件选择器对话框,其中显示的文本将由平台的区域设置(即在操作系统级别的用户机器上选择的区域设置)控制。请注意,这可能是您想要的,因为用户可能会按照他们想要的方式设置这些。您可以尝试更改区域设置,看看它是否更改了文件选择器。

Since these are native File Chooser dialogs, the text displayed in them will be controlled by the locale of the platform (i.e. 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.

这篇关于如何本地化JavaFX FileChooser对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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