I’m trying to get JFileChooser to display in english (defaults to german on my system). While localization is arguably a good thing, right at this moment for these small Swing apps (to be used internally) I don’t want it stuffed down my throat. So I’ve tried all of the following method calls:
from main():
Locale.setDefault(Locale.US);
System.setProperty(“user.language”, “en”);
System.setProperty(“user.country”, “US”);
UIManager.getDefaults().setDefaultLocale(new Locale(“en”, “US”));
JFileChooser.setDefaultLocale(new Locale(“en”, “US”));
and from actionPerformed():
fc.setLocale(new Locale(“en”, “”, “”)); // fc is instance of JFIleChooser
But the dialog box still shows up in german. Now if I pass -Duser.language=en -Duser.region=US to the vm it works just fine, but is there no programmatic way of getting around this? Or am I just missing some very fundamental concept?