File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Displaying a tree? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying a tree?" Watch "Displaying a tree?" New topic

Displaying a tree?

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 195
I am tasked with building an application using struts where the end user would input data and as that data is being inputted, a tree structure would be built and displayed on the data entry page. I have thought about scrubbing the entire struts part and doing a swing application but I am not sure if this would be permissible. Has anyone who would like to share your experiences done this before?
I was thinking generally along these lines; the data entered could be sent back on submit to the database. Perhaps in the database, along with storing the information, I could somehow store the structure of the tree and return it to be displayed? Any thoughts?

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 195
I realized I needed to refine things a bit. The data would actually be displayed more like a file system (yes, I know this is a tree as well). Didn't know if that added to the problem or not.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I've used trees extensively in my applications. What I have done is download one of the open source (or nearly open source) javascript tree controls. The two I have experience with are xTree by WebFX ( and treeView ( These tree controls allow the user to expand and contract nodes just as they would on Windows Explorer.

I have then written code that will generate the appropriate javaScript statements that will produce the tree that I want displayed.

There are also tree controls in other frameworks such as JSF and struts-menu.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Displaying a tree?
It's not a secret anymore!