Change windows keyboard in java?

限于喜欢 提交于 2019-12-18 16:48:34

问题


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.


回答1:


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

yourMainJFrame.getInputContext().selectInputMethod(new Locale("fa", "IR")); 


来源:https://stackoverflow.com/questions/14501842/change-windows-keyboard-in-java

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