Change input language in java

痴心易碎 提交于 2019-12-04 05:22:37

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/25959166/change-input-language-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!