The dirty flag on TextEditorPane is not being reset to false when all edits are undone.(I am assuming that all edits are Undoable and that any non-Undoable edit is handled specially by the particular application)

There are a number of approaches to a fix

[list=]allowing RUndoManager to be subclassed in RTextAreaexposing UndoManager in RTextArea as in UndoManager getUndoManager()providing canUndo(), canUndo() in RTextArea[/list]

The following snippets might help; it is from a subclass of TextEditorPane that gets over the problem