InputContext inputContext=null;
inputContext=frame.getInputContext();
inputContext.selectInputMethod(Locale.JAPAN);
This turns on Japanese IME. If you alter the locale to Locale.TAIWAN, or instantiate the class with language and country codes as:
Locale locale=new Locale("hi","IN");
then you can turn on the IME of your choice from your Java application.