Class DataRowTable

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

public class DataRowTable extends JTable implements ActionListener
A JTable to display rows of integers, doubles and Strings. BH 2020.03.30 See note in DataRowModel.java
Version:
1.0
Author:
Wolfgang Christian
See Also:
  • Field Details

    • labelColumnWidth

      protected int labelColumnWidth
  • Constructor Details

    • DataRowTable

      public DataRowTable()
      Constructor DataRowTable
  • Method Details

    • init

      protected void init()
      Initializes the table.
    • setRefreshDelay

      public void setRefreshDelay(int delay)
      Sets the Timer's initial time delay (in milliseconds) to wait after the timer is started before firing the first event.
      Parameters:
      delay -
    • clearFormats

      public void clearFormats()
    • setNumericFormat

      public void setNumericFormat(String str)
      Sets the default numeric display format pattern.
      Parameters:
      defaultFormat -
    • setColumnFormat

      public void setColumnFormat(int column, String format)
      Sets the column decimal format.
      Parameters:
      column - the column index
      format - the format
    • clearData

      public void clearData()
      Clears data from this table. Column names and format patterns are not affected.
    • clear

      public void clear()
      Clears data, column names, and format patterns.
    • setStride

      public void setStride(int stride)
      Sets the stride between rows.
      Parameters:
      tableModel -
      stride -
    • refreshTable

      public void refreshTable(String type)
      Refresh the data in the DataTable, as well as other changes to the table, such as row number visibility. Changes to the TableModels displayed in the table will not be visible until this method is called.
    • getCellRendererOrNull

      public TableCellRenderer getCellRendererOrNull(int row, int column, boolean isScrolling)
      This method is called only by JSTableUI for SwingJS option to not paint a cell.
      Parameters:
      row -
      column -
      isScrolling - indicates that this paint is due to a scrolling operation only.
      Returns:
      null to indicate not to paint, or the cell renderer to do so.
    • getCellRenderer

      public TableCellRenderer getCellRenderer(int row, int column)
      Returns the renderer for a cell specified by row and column.
      Overrides:
      getCellRenderer in class JTable
      Parameters:
      row - the row number
      column - the column number
      Returns:
      the cell renderer
    • actionPerformed

      public void actionPerformed(ActionEvent evt)
      Performs the action for the refresh timer by refreshing the data in the DataTable.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      evt -
    • scrollToEnd

      public void scrollToEnd()