Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Vector to Jtree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Vector to Jtree" Watch "Vector to Jtree" New topic
Author

Vector to Jtree

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
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 check this logic
1.Read through the vector and look for �ROOT�
2.remove Root and set it as Root in tree
3.look for �first child� of Root
4.add �first child�
5.look for child of �first child��continue on until no more children of children
6.go up one level and look for �second child��follow same logic
It seems reasonable but, I have no experience with Jtrees and I am having a heck of a time putting the steps into code. Any ideas?
 
 
subject: Vector to Jtree
 
Similar Threads
jtree and database
JTree
URGENT :- Creating JTree
getting first child after root in JTree
sorting jtree