Jörg
Jörg

Reputation: 291

Localizing JFileChooser.SAVE_DIALOG "Save in:" label

There is one item left which I don't know how to modify and that is the Save in: label when the dialogType is set to JFileChooser.SAVE_DIALOG.

As the label for Look in: shares the same place on the screen, I modified the lookInLabelText with UIManager.put("FileChooser.lookInLabelText", "..."), but to no avail.

Then I looked into the sources of JFileChooser.java, but there is not a single JLabel defined.

Upvotes: 1

Views: 80

Answers (1)

user3453226
user3453226

Reputation:

UIManager.put("FileChooser.saveInLabelText", "");

You must use either of:

JFileChooser chooser = new JFileChooser();
chooser.showSaveDialog(parent);
JFileChooser chooser = new JFileChooser();
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
chooser.showDialog(parent, null);

You must not use:

JFileChooser chooser = new JFileChooser();
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
chooser.showDialog(parent, "");

otherwise it becomes a CUSTOM_DIALOG, and FileChooser.lookInLabelText applies and dialogTitle must be set.

Upvotes: 1

Related Questions