| Summary: | Almost every toolkit and GUI library contains a tree component. The new JFC GUI library, Swing, follows this tradition by providing the JTree component. Looking "under the hood" of JTree we find lots of code, a few patterns, and quite a bit of functionality. Understanding this functionality and the patterns is essential to leveraging the component power to capture hierarchical objects structures. Like all Swing components, JTree is built around the Model-UI pattern -- a design in which each component is divided into a model part that holds the data and UI part that renders it. In this article, I'll explain JTree's model part and demonstrate how to use it for representing hierarchical objects structures. (3,500 words)
|