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.
Version:
1.2 10/27/98
Author:
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:

<dependency>
    <groupId>org.cytoscape</groupId>
    <artifactId>swing-util-api</artifactId>
</dependency>
  • Constructor Details

    • JTreeTable

      public JTreeTable(TreeTableModel treeTableModel)
      Creates a new JTreeTable object.
      Parameters:
      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.
      Overrides:
      getToolTipText in class JTable
      Parameters:
      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.
      Overrides:
      updateUI in class JTable
    • getEditingRow

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

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

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