Class JTreeTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable

public final class JTreeTable extends JTable
This example shows how to create a simple JTreeTable component, by using a JTree as a renderer (and editor) for the cells in a particular column in the JTable.
1.2 10/27/98
Philip Milne, Scott Violet
See Also:

Cytoscape Backwards Compatibility (Final Class): This class is final and therefore can't be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.

Module: swing-util-api

To use this in your app, include the following dependency in your POM:

  • Constructor Details

    • JTreeTable

      public JTreeTable(TreeTableModel treeTableModel)
      Creates a new JTreeTable object.
      treeTableModel - The tree table model.
  • Method Details

    • getToolTipText

      public String getToolTipText(MouseEvent event)
      The code in this method is copy and pasted from source code to the same method in javax.swing.JTable, except for one value change on one line. If you'd like to see the change, please read the source code below.
      getToolTipText in class JTable
      event - the mouse event we're reacting to
    • updateUI

      public void updateUI()
      Overridden to message super and forward the method to the tree. Since the tree is not actually in the component hierarchy it will never receive this unless we forward it in this manner.
      updateUI in class JTable
    • getEditingRow

      public int getEditingRow()
      Returns the row being edited.
      getEditingRow in class JTable
      the row being edited.
    • setRowHeight

      public void setRowHeight(int rowHeight)
      Overridden to pass the new rowHeight to the tree.
      setRowHeight in class JTable
      rowHeight - the new height of the row
    • getTree

      public JTree getTree()
      Returns the tree that is being shared between the model.
      the JTree that is being shared between the model.