Search code examples
javaswingjtextfieldjtextareahebrew

Change input language in java


My application is in Hebrew. The computers that are running my app all have English set as the default language and Hebrew as the secondary language.

Every time they need to input stuff to my JTextFields, they have to "alt + shift" to change language, Some of them don't even look at the monitor and just begin to write, and I get gibberish because they wrote in Hebrew but with English chars :)

Is it possible to set the language when a JTextFields gets the focus , or maybe in some other way ?

thanks,

Dave


Solution

  • Try jTextField.getInputContext().selectInputMethod(new Locale("iw", "IL")); on FocusGained event