void (final int start, final int end) { SwingUtilities.invokeLater(() -> { EditorTextField textField = getEditorTextField(); if (textField == null) return; textField.select(TextRange.create(start, end)); textField.setCaretPosition(end); }); }