你能告诉我一些关于如何撤消Jtree的简单代码示例吗?我的Jtree是可编辑的。这是我的示例代码:
treeModel = new DefaultTreeModel(root);
tree = new UndoableTree(treeModel);
manager = new UndoManager();
tree.addUndoableEditListener(manager);
undoAction = new UndoAction(manager);
redoAction = new RedoAction(manager);
undoButton.addActionListener(undoAction);
tree.setInvokesStopCellEditing(true);
tree.setEditable(true);
tree.setDragEnabled(true);