Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change windows keyboard in java?

I'd like to change the windows keyboard that is currently being used programatically.

I'm writing a dictionary program for an eastern language, and I want it to switch to another keyboard when the user clicks in a different table column.

I looked into this and found example using Windows PowerShell, and native C++ code. The PowerShell did not seem to work and I'm not familiar with the native Windows API and C. Any help on how to actually get this done in Java would be greatly appreciated.

like image 808
JavaMonkey22 Avatar asked Jan 24 '13 12:01

JavaMonkey22


1 Answers

Here's a blog post that explains how to do it: change input method
In a nutshell:

yourMainJFrame.getInputContext().selectInputMethod(new Locale("fa", "IR")); 
like image 152
vitalii Avatar answered Nov 10 '22 22:11

vitalii