Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tree structure like window explorer ... database driven

 
Sandeep. Oza
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greg Brouelette
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sandeep. Oza
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic