aspose file tools*
The moose likes Beginning Java and the fly likes Recursive Tree Problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Recursive Tree Problem..." Watch "Recursive Tree Problem..." New topic

Recursive Tree Problem...

Sanket L Shah
Ranch Hand

Joined: May 08, 2009
Posts: 49

Hi all,

I am developing one application using hibernate and Swing.
I am having one user class.

I have given lazy = "false" in user.cfg.xml. When I run this program using void main... it works well...
now my problem is how can I iterate loop so i can get all the data in tree structure...
I wanted to display the data in Tree Structure... but not able to write correct recursive loop...
Please help me out.....

Thank you so much....

Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230

What have you tried so far? What comes to mind is iterating over each user and printing out its sub-users recursively, for example:

This assumes there are no cyclical relationships. This may not be exactly what you want, but hopefully it should help get you started.


Jeff Storey
Software Developer
Sanket L Shah
Ranch Hand

Joined: May 08, 2009
Posts: 49

Hey tha Jeff Storey
MY problem is solved......
Thank you so much....
I agree. Here's the link:
subject: Recursive Tree Problem...
Similar Threads
Tree Recursive problem
Recursive Tree Problem
Making binary tree: memory problem
Recursive object creation from List
Trying to bind data to a TreeNode attribute using data read from a web service with simple xml