public void insertUpdate(DocumentEvent e) { setModified(true); }
public void removeUpdate(DocumentEvent e) { setModified(true); }
});
// Listen for undo and redo events
textArea.getDocument().addUndoableEditListener(new UndoableEditListener() {
public void undoableEditHappened(UndoableEditEvent evt) {
undo.addEdit(evt.getEdit());
firePropertyChange("undoAvailable", false, true);
firePropertyChange("redoAvailable", false, true);