Aly Ahmed Mohamed Aly Ahmed Mohamed - 1 year ago 136
Java Question

Change system language in java programming.

there is way to change system language in java programming. I do java dictionary app so I use two jtextfield one for English and other for Arabic I want when focus in English jtextfield system language convert to english and like in jtextfield arabic there any way to do that ?

Answer Source

Try using this methods:

public void setArabic(JTextField txt) {
    txt.getInputContext().selectInputMethod(new Locale("ar", "SA"));

public void setEnglish(JTextField txt) {
    txt.getInputContext().selectInputMethod(new Locale("en", "US"));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download