public void undoableEditHappened(UndoableEditEvent e) { UndoManager mgr = Undo.getCurrentUndoMgr(); if (mgr != null && mgr.canRedo()) { setToolTipText(mgr.getRedoPresentationName()); setEnabled(true); } else { setToolTipText(tipStr); setEnabled(false); } }
public void actionPerformed(ActionEvent e) { UndoManager undo = menu.getCurScoreObject().manager; try { undo.undo(); menu.setCurSaveFlag(false); p.repaint(); } catch (CannotUndoException ex) { // System.out.println("Unable to undo: " + ex); // ex.printStackTrace(); } }
public void actionPerformed(ActionEvent e) { UndoManager mgr = Undo.getLastUndoMgr(); if (mgr != null && mgr.canRedo()) mgr.redo(); }