You can intercept CHANGE changes and wrap them in another UndoableEdit, the method isSignificant()returns falsebefore adding it to UndoManager. Each Undo command then rolls back the last INSERT or REMOVE changes, as well as every CHANGE change that has occurred since then.
, , , , JTextPane/StyledDocument/etc. . , , . ( ) , , , , , .
, Swing JTextComponent, View Document. , JEdit, javax.swing.text, , .