public void jButton2_actionPerformed(ActionEvent e) {   
        String name = javax.swing.JOptionPane.showInputDialog(this, "输入节点名字: ");   
        if (name == null || name.equals(" ")) {   
            return;   
        }   
        if (allTreeNodeNameList.contains(name.trim())) {//节点名称不能有重复的   
                // 数据库操作失败，无法验证用户! 系统错误   
         JOptionPane.showMessageDialog(this, "节点名称已经存在，添加失败！","错误",   
                                       JOptionPane.ERROR_MESSAGE);   
         return;   
  
        }   
        DefaultMutableTreeNode selected = (DefaultMutableTreeNode) tree.   
                                          getLastSelectedPathComponent();   
        if (selected == null) {   
            return;   
        }   
        DefaultMutableTreeNode node = new DefaultMutableTreeNode(name);   
        //添加到树节点   
        model.insertNodeInto(node, selected, 0);   
        TreePath path = new TreePath(node.getPath());   
        tree.makeVisible(path);   
    }