Student
Student

Reputation: 28375

Where are the java swing String for me to translate?

The JFileChooser don't provide support for my language, I'd translate strings defined in the file http://www.rgagnon.com/javadetails/JavaUIDefaults.txt with the UIManager.put(), but I'm not finding the popup strings ("view", "refresh" and "new folder" options when you right-click).

Does anyone know where can I find them to translate?

--update

The FileDialog creates a native dialog, which solves the translation problem, but leads to another question.

--update

Best solution for now: use the system default LAF, so the JFileChooser is system's native dialog and don't need translation. Bad I can't use Nimbus..

Upvotes: 3

Views: 546

Answers (2)

FlexEast
FlexEast

Reputation: 317

These are the UIManager strings for the JFileChooser context menu. This example is setting them in english.

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");

Upvotes: 1

lins314159
lins314159

Reputation: 2520

Seems to be sun.swing.FilePane that has the Strings, which are then used by javax.swing.plaf.basic.BasicFileChooserUI.

Upvotes: 1

Related Questions