Vector « JTree « Java Swing Q&A





1. Display all elements of vector in JTree as separate node    coderanch.com

Boy aren't you lucky I've just been studying this same subject! You could subclass DefaultMutableTreeNode, (give it a shorter name, while you're at it!! Like FileNode.) and give it a constructor that takes a vector. This constructor will have to call the .addChildren and/or addNode methods appropriately. You'll want to add a node for each directory or file. You can use ...

2. Vector to Jtree    coderanch.com

I am storing a tree structure in a database (two fields, basically one identifying this node and one identifying its parent). I can not be sure of how the data will be returned to me. Is there a way to convert a vector to a jtree easily? I am guessing no but I thought I would ask. If not then please ...

3. jtree question - vector for root    forums.oracle.com

Hi I'm implementing a JTree and planned to use a vector of clubs to represent root? Is this possible? My JTree, using this call, top = new DefaultMutableTreeNode(t.getRoot()); is getting [Rowing, Diving, Tennis, Show Jumping] as an example. I'm not sure if this is right - there will only ever be clubs and members with members and clubs without members being ...

4. How to use Vector or other ArrayList etc to store my JTree??    forums.oracle.com

I have following code can add classes and students in the JTree, in class Computer Science, it has student Bill Brien, in Math, no, Then I I add Student Nancy, Laura, Peter into Computer Science Class, add AAAA, BBB, CCC into Math class, I create a new class called Chemistry, then I add DDD int Chemistry; so this JTree is dynamically ...