Package ball.swing.table
Class SimpleTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- ball.swing.table.AbstractTableModelImpl
-
- ball.swing.table.ArrayListTableModel<Object[]>
-
- ball.swing.table.SimpleTableModel
-
- All Implemented Interfaces:
Serializable
,EventListener
,TableModelListener
,TableModel
public class SimpleTableModel extends ArrayListTableModel<Object[]>
SimpleTableModel
implementation.- Author:
- Allen D. Ball
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description SimpleTableModel(Object[][] rows, int columns)
SimpleTableModel(Object[][] rows, String... names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
getValueAt(Object[] row, int x)
Implementation method to retrieve a column value from a row object.SimpleTableModel
row(Object... row)
Convenience method to add a new row.-
Methods inherited from class ball.swing.table.ArrayListTableModel
getRowCount, getValueAt, list
-
Methods inherited from class ball.swing.table.AbstractTableModelImpl
column, getColumnClass, getColumnCount, getColumnName, header, isCellEditable, row, setColumnClass, setColumnName, setValueAt, tableChanged
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Constructor Detail
-
SimpleTableModel
public SimpleTableModel(Object[][] rows, String... names)
- Parameters:
rows
- TheTableModel
's rows.names
- The column names.- See Also:
ArrayListTableModel(Iterable,String...)
-
SimpleTableModel
public SimpleTableModel(Object[][] rows, int columns)
- Parameters:
rows
- The TableModel's rows.columns
- The number of columns.- See Also:
ArrayListTableModel(Iterable,int)
-
-
Method Detail
-
row
public SimpleTableModel row(Object... row)
Convenience method to add a new row.- Parameters:
row
- The array ofObject
s that make up the row to be added.- Returns:
this
SimpleTableModel
.
-
getValueAt
protected Object getValueAt(Object[] row, int x)
Description copied from class:ArrayListTableModel
Implementation method to retrieve a column value from a row object.- Specified by:
getValueAt
in classArrayListTableModel<Object[]>
- Parameters:
row
- TheObject
representing the row.x
- The column index.- Returns:
- The column value from the row.
-
-