撤消JTree?

时间:2012-02-07 03:24:40

标签: java swing jtree undo

你能告诉我一些关于如何撤消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);

0 个答案:

没有答案