不是GUI的,就是内存中形成一棵树啊

解决方案 »

  1.   

    需要自己实现,可以定义一个class,作为节点,比如说:
    class leaf{
        Leaf leftChild;
        Leaf rightChild;
        public Leaf getLeftChild()
        {
            return leftChild;
        }
        public Leaf getRightChild()
        {
            return rightChild();
        }
        public void setLeftChild(Leaf newLeaft)
        {
            this.leftChild = newLeaf;
        }
        pbublic void setRightChild(Leaf newRight)
        {
            this.rightChild = newRight;
        }
    }
    然后编写一个Tree的类,实现树的一些操作即可,如初始化,添加节点,删除节点即可。
      

  2.   

    直接用TreeSet,新的数据集里有的,具体看核心技术2
      

  3.   

    其实Vector,HashTable,HashMap,TreeMap什么的都可以表示一棵树,不过要用也可以直接用JTree啊,不显示就不显示呗,完全可以作为一个数据结构来用啊