How can we make tree widgets, like in Swing, in an HTML page?

Michael Szlapa

I can think of three options:

1. Use the JavaScript to built the tree in the browser.
Various JavaScript trees are available on the internet, including free implementations. JavaScript will usually offer the highest performance. Unfortunatelly due to the differences in JavaScript support in various browsers I would only recommend it for intranet solution where you can standarize browser settings and version.

[Does anyone have links to these JavaScript trees? -A]

2. Build an applet and place it on the JSP page.

Applets tend to be less browser dependent. Large applets may be slow to load over low-bandwidth connections and they are also slow to start on older computers. Also applets may be disabled in the browser or not be available inside the firewall.

[Does anyone have links to these Applet trees? -A]

3. Build your tree logic on the server side using JSP or servlet technology. Avery node is the hyperlink, when clicked the server side generates new page where given node is expanded/colapsed.

This is potentially the slowest but the most robust solution - works always. This solution will not allow you to use drag and drop functionality.