Let's say you have a JEditorPane with which you have registered both an UndoableEditListener and a DocumentListener. When you change the underlying document's contents by typing in the editor pane, what is the order in which the events are fired?
In addition, I assume that, in the interest of efficiency, calling either of these methods:
...will not trigger a new UndoableEdit event, but will still trigger a new DocumentEvent. Can anyone confirm whether this is indeed the case?
After trying what camickr suggested, it seems that this is the order of events:
When typing in the editor pane (including cutting, copying and pasting) or changing the document font/style, the document will fire a DocumentEvent before it fires an UndoableEditEvent.
When calling UndoableEdit.undo() or UndoableEdit.redo(), only a corresponding DocumentEvent will be fired.