• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Vector to Jtree

 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
It's a tiny ad only because the water is so cold.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic