Can I change language by JTextField gained focus(Java)

by 5 replies
6
I create some application by using java UI. And I want to change language when I focus on other JTextField.

EX.


When I focus on JTextField upper. Language will switch to English. But when I focus on JTextField lower. Language will switch to other language.

Ps. I come from country where don't use English is Official language.
If I use wrong word or wrong tense. Please provide me a correct word.
Thank you
#programming #change #focusjava #gained #jtextfield #language
  • I don't think you'll find very many people that know Java around here. Might try one of the Java forums...

    java forum - Google Search
    • [1] reply
    • Thank you for advice.
  • I am learning Java for Android development.
    I think you will have to change the locale by using .selectInputMethod(new Locale())like this for french:

    Code:
    txt.getInputContext().selectInputMethod(new Locale("fr","FR"))
    InputMethod (Java Platform SE 7 )
    • [1] reply
    • You're correct, that should work. How are you liking Android Dev?
      • [1] reply

Next Topics on Trending Feed