BeeSoft®
Since 1992
 

Content

 Welcome
 Products
       Abeona
       Gaia
             News
             Documentation
                   Introduction
                   Swing support
                         Components
                               JCalendar
                               Lazy tree loading
                               JTreeTable
                               Simple form
                               Form
                         Building from XML
                         Client / server
                   Server application
                   Validation
                   XML
                   Logging
                   Utilities
                   Launcher
             License
             Download
       Hephaistos
       JavaGantt
 Services
       Promote your software
 Contact Us
 Links
      
  GaiaI®
© 2012 BeeSoft ®
 

JTreeTable

A JTreeTable is a combination of a JTree and a JTable - a component capable of both expanding and contracting rows, as well as showing multiple columns of data.

This component always displays a tree in the first column and the additional data in the next columns. You can see its usage in a very simple example of the directory tree.

The code in this class is derived from the source from the JTreeTable article that can be found at: http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html.

This component has the next features:

  • it inherits from its parent class ability to hide / show columns
  • also inherits possible "zebra" look
  • the tree is always painted in the first column
  • as its model you must use TreeTableModel or subclasse it
  • supports data lazy loading
  • descendants of the TreeTableNode are only nodes acceptable in the JTreeTable

The TreeTableModel which is used as model for JTreeTable, extends javax.swing.tree.DefaultTreeModel to meet the requirements for model for JTreeTable.

The TreeTableNode is hierarchical node for the JTreeTable. It inherits lazy loading possibility from the ExplorableTreeNode and adds the methods for get / set value for required column.