fill a JTree
Posted on 2003-03-13
I have to fill a JTree with data. The data are stored in a vecor (int, string). The int is the level number:
The element with the number 1 is the root element. I can add this to the tree like this:
"root.add(new DefaultMutableTreeNode("Child 2"));"
But how can I add the other elements without using a variable name for them? I can have up to 10 levels. I need the tree only to display the in information. No actionlistener needs to be added.
Thanks in advance!