IME変更 2007/01/30

テキストコンポーネントにフォーカスリスナーをあたえる。
フォーカスがかわるときにendCompositionで確定してあげるといいっぽい。


public void focusGained(FocusEvent e) {
textComponent.getInputContext().setCharacterSubsets(
new Character.Subset[] { InputSubset.KANJI });
}

public void focusLost(FocusEvent e) {
textComponent.getInputContext().endComposition();
textComponent.getInputContext().setCharacterSubsets(null);
}

: