tree structure like window explorer ... database driven
Sandeep. Oza
Ranch Hand
Joined: Feb 04, 2002
Posts: 66
posted
0
Friends, I have data in SQL database.. and i want to display it in tree structure as window explorer. database bean returns Hashtable. Is there any site explaining this funda? ( without using Swing JTree Class). S. Oza
Yes, Everything Is Possible
Greg Brouelette
Ranch Hand
Joined: Jan 23, 2002
Posts: 144
posted
0
Well, I don't see any reason why you wouldn't want to use a JTree. Or is this one of those stupid teacher assignments where they say "Build a button without using JButton" or some such? You could take a look at the source code in my sourceforge project at http://sourceforge.net/project/showfiles.php?group_id=10887 I have a class in there called QuickTree that builds a tree correctly if you pass it a slash delimited list of "directories" and the leaf object OR a vector of "directories" and the leaf object. It uses JTree, but it makes implementation of the JTree really easy. That source code may get you closer to what you need.
For a good Prime, call:<br />29819592777931214269172453467810429868925511217482600306406141434158089
Sandeep. Oza
Ranch Hand
Joined: Feb 04, 2002
Posts: 66
posted
0
Thankx Greg, I shall go through your source codes ... The reason i don't want to use JTree is that... It requires separate Plug in with Browser( Is it true.?.. I am not sure). Also my data is stored in SQL database which returns two hashtables.. one returns fixed parent nodes( 5 no.s like A,B,C drives...) and second one all chil..sub child records... How to Nest Hashtable? Let me first go through your source codes. Good day. S. Oza