• 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

how to store & retrieve the content of JTree to & from the database

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
my question is how to retireve the data from the database
after that the data should be display as a Jtree format.
first i stored the data into the database from the JTree.
tree contains
parent child leaf eg.
p
p1
p11
p111
p112
p12

p2
p21
p221
p222
p22

like that from the above tree
parent contains
2 subnode p1,p2
p1 contains p11,p12
p11 contains two leaves p111,p112
p2 is empty
and so on.
i stored sucessfully
i used vector to retrieve also
after that i am not able to dispaly the data as tree
the tree is not binary tree
it will have more than one level.
if u have idea reply me.
thankz in advance.

by
Rose.

[ February 03, 2006: Message edited by: Rose --- ]

[ February 04, 2006: Message edited by: Rose --- ]
[ February 04, 2006: Message edited by: Rose --- ]
 
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Rose ---",

Please review the JavaRanch Naming Policy and change your display name. You may do that here.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I recall responding to a similar posting of yours, but it seems to have disappeared. Again, there are two things to understand here: a JTree's TreeModel and how to save and retieve this data. Step one would be to forget about the database and just make sure you understand how TreeModel works. Have you read Sun's tutorial, concentrating on when they discuss JTree's TreeModel?

http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

You write about storing data in a Vector, which might (might!) be an intermediate form of your tree's data, but which isn't sufficient.
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic