Re: can JTree's have multiple roots and models ?




"William Z." <Wizumwalt@xxxxxxxxx> wrote in message
news:1130431528.928978.108140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I want to change my tree around and I have the following questions
> about a JTree?
>
> - Can a JTree can have several root nodes?
> - Can a JTree have several TreeModel's for each root node?

I suspect the answer is "no" to both, but I'm not sure.

Have you considered taking all your trees, and making them children of a
so-called "super root", and then using that as the root of the JTree?

Similarly, take all your TreeModels and make them children of a
"super-TreeModel", and make that the model for your JTree.

- Oliver


.



Relevant Pages

  • Re: spacing problem with a JTree
    ... >> a root and three layers of children. ... as i normally get when using a JTree. ... i was not using a tree model. ... for the nodes that occupy more vertical space than they ...
    (comp.lang.java.programmer)
  • spacing problem with a JTree
    ... a root and three layers of children. ... the spacing between the nodes representing the children of the ... as i normally get when using a JTree. ...
    (comp.lang.java.programmer)
  • Re: Enumerating a JTree
    ... >How can I list all the nodes in a JTree? ... find all the nodes in the root. ... http://mindprod.com Java custom programming, consulting and coaching. ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: remove all nodes from a JTree?
    ... I have implemented a JTree, with a root ... > build up tree keeps showing with the old nodes instead of the newly added. ... http://reader.imagero.com Java image reader ...
    (comp.lang.java.gui)
  • remove all nodes from a JTree?
    ... I have this problem with my JTree. ... with a root ... where I add all my nodes on the first level. ... the root node, according to the newly selected element, that the first ...
    (comp.lang.java.gui)