public interface TableModel

Known subtypesUiBinding.BoundTableModel, AbstractTableModel, DefaultTableModel, SortableTableModel

The table and table model class are complimentry classes allowing the quick construction of tabular data controls. The table model represents the data source according to which the table is constructed.

Methods

public abstract int getRowCount()Returns the number of rows in the table
public abstract int getColumnCount()Returns the number of columns in the table
public abstract String getColumnName(int i)Returns the name of the column at the given offset
public abstract boolean isCellEditable(int row, int column)Returns true if the cell at the given location is an editable cell
public abstract Object getValueAt(int row, int column)Returns the value of the cell at the given location
public abstract void setValueAt(int row, int column, Object o)Sets the value of the cell at the given location
public abstract void addDataChangeListener(DataChangedListener d)Adds a listener to the data changed event
public abstract void removeDataChangeListener(DataChangedListener d)Removes a listener to the data changed event

Method details

getRowCount

public abstract int getRowCount()
Returns the number of rows in the table

Returns

the number of rows in the table

getColumnCount

public abstract int getColumnCount()
Returns the number of columns in the table

Returns

the number of columns in the table

getColumnName

public abstract String getColumnName(int i)
Returns the name of the column at the given offset

Parameters

i int
the offset for the column name

Returns

name to display at the top of the table

isCellEditable

public abstract boolean isCellEditable(int row, int column)
Returns true if the cell at the given location is an editable cell

Parameters

row int
the cell row
column int
the cell column

Returns

true if the cell at the given location is an editable cell

getValueAt

public abstract Object getValueAt(int row, int column)
Returns the value of the cell at the given location

Parameters

row int
the cell row
column int
the cell column

Returns

the value of the cell at the given location

setValueAt

public abstract void setValueAt(int row, int column, Object o)
Sets the value of the cell at the given location

Parameters

row int
the cell row
column int
the cell column
o Object
the value of the cell at the given location

addDataChangeListener

public abstract void addDataChangeListener(DataChangedListener d)
Adds a listener to the data changed event

Parameters

d DataChangedListener
the new listener

removeDataChangeListener

public abstract void removeDataChangeListener(DataChangedListener d)
Removes a listener to the data changed event

Parameters

d DataChangedListener
the listener to remove