只需更改您当前的删除方法:
@Override public void remove(documentFilter.FilterBypass fb, int offset, int length) throws BadLocationException { fb.insertString(offset, "", null); }为此:
@Override public void remove(documentFilter.FilterBypass fb, int offset, int length) throws BadLocationException { fb.remove(offset, length); }现在应该可以了。



