Skip to main content

getKeyText() always in English? [Solved]

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
linc
Offline
Joined: 2011-05-10

Is it possible to get the String KeyEvent's getKeyText() returns to always be in English? The documentation says that it "can be localized by changing the awt.properties file" but I haven't really figured out how. I also guess it only changes the values when running the program on my computer and I want it to be in English wherever and whenever I run it. Can it be solved using Locale or something?
Any help would be appreciated!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
linc
Offline
Joined: 2011-05-10

Locale.setDefault(new Locale("en", "us"));