I am using a Java program with foreign operating system (Korean/Japanese etc.) The display of swing components such as FileChooser is in the foreign langauges, which I need to change to English.
java.util.Locale.setDefault(java.util.Locale.ENGLISH);
JFileChooser chooser = new JFileChooser();
chooser.setLocale(Locale.ENGLISH);
And the file chooser still shows everything - buttons etc. in these foreign langauges. Any idea how to fix it?
My JFilechooser's button's OK/CANCEL are showing in Japanese. I'm using Japanese Windows. How to change that to English?
Go to app > res > values > right-click > New > Value Resource File and name it as strings. Now, we have to choose qualifiers as Locale from the available list and select the language as Hindi from the drop-down list. Below is the picture of the steps to be performed.
The Java Locale class object represents a specific geographic, cultural, or political region. It is a mechanism to for identifying objects, not a container for the objects themselves. A Locale object logically consists of the fields like languages, script, country, variant, extensions.
Locale Class is used to perform locale task and provides locale information for the user. Constructors : Locale(String L): Creates Locale form the given language code. Locale(String L, String C): Creates Locale form the given language, country code.
You can specify language when you start the VM.
java -Duser.language=en -Duser.country=US -Duser.variant=US MainClass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With