void (final int startOffset, final int endOffset) { try { myTextComponent.getDocument().remove(startOffset, endOffset - startOffset); } catch (BadLocationException e) { throw new RuntimeException(e); } }