java swing字符串在哪里翻译?

时间:2010-03-17 23:29:21

标签: java swing translation jfilechooser uimanager

JFileChooser不支持我的语言,我会使用UIManager.put()翻译文件http://www.rgagnon.com/javadetails/JavaUIDefaults.txt中定义的字符串, 但是当你右键单击时,我找不到弹出字符串(“视图”,“刷新”和“新文件夹”选项)。

有谁知道我在哪里可以找到它们进行翻译?

- 更新

FileDialog创建了一个原生对话框,可以解决翻译问题,但会导致another question

- 更新

现在的最佳解决方案:使用系统默认的LAF,因此JFileChooser是系统的本机对话框,不需要翻译。坏我不能使用Nimbus ..

2 个答案:

答案 0 :(得分:1)

似乎是sun.swing.FilePane有字符串,然后由javax.swing.plaf.basic.BasicFileChooserUI使用。

答案 1 :(得分:0)

这些是JFileChooser上下文菜单的UIManager字符串。这个例子是用英语设置的。

UIManager.put("FileChooser.detailsViewActionLabelText", "Details");
UIManager.put("FileChooser.listViewActionLabelText", "List");
UIManager.put("FileChooser.viewMenuLabelText", "View");
UIManager.put("FileChooser.refreshActionLabelText", "Refresh"));
UIManager.put("FileChooser.newFolderActionLabelText", "New Folder");