问题
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