I am building a Text Editor in Java(Swing) having an EditorPane to type the text and a Menu containing JRadioButtonMenuitems. Like Menu is "Language" and JRadiobuttonMenuitems under "Language" are "Spanish","Japanese","English" etc the scenario is that when user clicks and select any JRadioButtonMenuItem the system must change its IME as per the selected language. Like if user click and select Japanese option Editor must change the IME to Japanese for current process and allow user to enter text in respective language.
I've got the proper IME installed. Manually I can change the IME and able to write in a swing component. but my problem is how to load the IME programmatically.
Currently i am building this application on windowsXP but want this application to change IME language for each operating system.
I have google it but havenot found any related information to change IME.
Thanks
IME Language can be changed for the JEditorPane by getting an InputContext instance and overriding getInputContext method for JEditorPane like.
and on selection of any language like on click of japanese JRadioButtonMenuItem add an ActionListener
do the following inside event handler.
I have tried this out on Windows Xp. Its working perfectly fine.