void () { initText("ab<caret>cd"); ((EditorEx)getEditor()).setInsertMode(false); JComponent component = getEditor().getContentComponent(); component.dispatchEvent(new InputMethodEvent(component, InputMethodEvent.INPUT_METHOD_TEXT_CHANGED, new AttributedString("\uD83D\uDE00" /* 'GRINNING FACE' emoji (U+1F600) */).getIterator(), 2, null, null)); checkResultByText("ab\uD83D\uDE00d"); }