DefaultMutableTreeNode root = new DefaultMutableTreeNode("根节点");//创建根节点 DefaultMutableTreeNode nodeFirst = new DefaultMutableTreeNode("子节点1");//创建一级节点 root.add(nodeFirst);// 将一级节点添加到根节点 DefaultMutableTreeNode nodeSecond = new DefaultMutableTreeNode("子节点1.1", false);//创建不允许有子节点的二级节点