Package smile.swing

Class Table

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable, org.jdesktop.swingx.event.TableColumnModelExtListener

public class Table extends org.jdesktop.swingx.JXTable
Customized JTable with optional row number header. It also provides the renderer and editor Color and Font. It also provides a renderer for Float/Double of special values (such as NaN and Infinity).
See Also:
  • Constructor Details

    • Table

      public Table()
      Constructs a default JTable that is initialized with a default data model, a default column model, and a default selection model.
    • Table

      public Table(int numRows, int numColumns)
      Constructs a JTable with numRows and numColumns of empty cells using DefaultTableModel.
      Parameters:
      numRows - the number of rows the table holds.
      numColumns - the number of columns the table holds.
    • Table

      public Table(Object[][] rowData, Object[] columnNames)
      Constructs a JTable to display the values in the two dimensional array, rowData, with column names, columnNames.
      Parameters:
      rowData - the data for the new table.
      columnNames - the names of each column.
    • Table

      public Table(TableModel dm)
      Constructs a JTable that is initialized with dm as the data model, a default column model, and a default selection model.
      Parameters:
      dm - the data model for the table
    • Table

      public Table(TableModel dm, TableColumnModel cm)
      Constructs a JTable that is initialized with dm as the data model, cm as the column model, and a default selection model.
      Parameters:
      dm - the data model for the table.
      cm - the column model for the table.
    • Table

      public Table(TableModel dm, TableColumnModel cm, ListSelectionModel sm)
      Constructs a JTable that is initialized with dm as the data model, cm as the column model, and sm as the selection model
      Parameters:
      dm - the data model for the table.
      cm - the column model for the table.
      sm - the row selection model for the table.
  • Method Details

    • getScrollableTracksViewportWidth

      public boolean getScrollableTracksViewportWidth()
      Specified by:
      getScrollableTracksViewportWidth in interface Scrollable
      Overrides:
      getScrollableTracksViewportWidth in class org.jdesktop.swingx.JXTable
    • getCellRenderer

      public TableCellRenderer getCellRenderer(int row, int column)
      Overrides:
      getCellRenderer in class org.jdesktop.swingx.JXTable
    • getCellEditor

      public TableCellEditor getCellEditor(int row, int column)
      Overrides:
      getCellEditor in class JTable
    • getRowHeader

      public JTable getRowHeader()
      Returns a row header for this table. The row header must be added to the row header of the JScrollPane that contains this table.
      Returns:
      the row header component.