super.removeUpdate(event);
int p0 = event.getOffset(); int p1 = event.getLength() + p0; int len = event.getLength();   int i1 = rootElement.getElementIndex(p0); int i2 = rootElement.getElementIndex(p1); if (i1 != i2) { Element el1 = rootElement.getElement(i1); Element el2 = rootElement.getElement(i2); int start = el1.getStartOffset(); int end = el2.getEndOffset();  Element newEl = createLeafElement(rootElement, SimpleAttributeSet.EMPTY, start, end - len); rootElement.replace(start, end - start, new Element[]{ newEl }); } else {  LeafElement el1 = (LeafElement) rootElement.getElement(i1); el1.end -= len; }   for (int i = rootElement.getElementIndex(p0) + 1; i < rootElement.getElementCount(); i++) { LeafElement el = (LeafElement) rootElement.getElement(i); el.start -= len; el.end -= len; }
  protected void removeUpdate(DefaultDocumentEvent event)  {    reindex();    super.removeUpdate(event);    }