Version 9, last updated by Sachin Mittal at May 28, 2009 09:07 UTC
This is a java swing component having UI rendering with a difference. Further it gives an opportunity to study some of the tree and graph algorithms. Check yourself to find out!
Pre-requisite
Java must be installed on your local machine (where the program is run i.e. either as desktop application of java applet inside a browser).
The latest version of java can be installed from:
http://www.java.com/en/download/manual.jsp
The program has been tested on JRE version 1.5.x or lower.
If you just want to run the application and play with it or use it, downloading JRE is fine. In case you want to develop this application further you would need JDK
Tree
Tree's are perhaps most common component we use on our computer.
Simplest example can be the file explorer on your computer. On the left side pane we can see the tree component displaying the hierarchy of the files and directories present on your component.
This is just one such example. Data/information is usually aggregated in hierarchies and are stored in various formats. Thus there is a need to display this information stored. Many visual components have been developed in many different technologies, which essentially fetch the information from data stores, construct a tree data structure out of them and display it to the users.
This component written in Java does the same. The difference is that it displays information with a different look and feel than the traditional components do (for example our file browser).
If we look at the file browser, the root of the tree is displayed on the top right corner of the frame, and its children appear below it, indented on the right. Same way rest of the nodes are displayed.
In the component the root is displayed on the top center of the frame, its children appear vertically below the root, indented down. Same way rest of the nodes are displayed. Thus the look and feel is like an (actual) vertical inverted tree.
The image you see on left is how the tree would look like when the root is expanded.
The image now you see on left is when two children are added to one of the node and that node is expanded. Note you can render the node in many ways, chaging the icon, background color, font etc.
So above two images will give you an fair idea of how the software works. If you are excited to know more, please click the links below to get started with an example and see how this swing component works and can be integrated with any desktop swing based applications or java applet.
Click the link below to straight way run and play with a small demo application
https://www.assembla.com/wiki/show/java_tree/Running_a_small_application
If you want to build an application yourself, need to look at the code follow this link below:
http://www.assembla.com/wiki/show/java_tree/Downloading_the_software_and_testing_it
The owner is sjmittal