How to check current keyboard language in java

无人久伴 提交于 2021-01-27 06:37:43

问题


is there a way in java to check what is the keyboard language in the current program? example:

Chrome : english

Eclipse: english

Skype: spanish

Chrome: english

(i can get the current program by jna - external library)

thanks very much !


回答1:


Try this:

import java.awt.im.*;  

public class _Test  
{  
    public static void main(String[] args)  
    {  
        InputContext context = InputContext.getInstance();  
        System.out.println(context.getLocale().toString());  
    }  
} 


来源:https://stackoverflow.com/questions/17150993/how-to-check-current-keyboard-language-in-java

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