Packageorg.aswing.table
Interfacepublic interface TableModel
ImplementorsAbstractTableModel

The TableModel interface specifies the methods the JTable will use to interrogate a tabular data model.



Public Methods
 MethodDefined by
  
Adds a listener to the list that is notified each time a change to the data model occurs.
TableModel
  
getColumnClass(columnIndex:int):String
Returns the most specific superclass for all the cell values in the column.
TableModel
  
Returns the number of columns in the model.
TableModel
  
getColumnName(columnIndex:int):String
Returns the name of the column at columnIndex.
TableModel
  
Returns the number of rows in the model.
TableModel
  
getValueAt(rowIndex:int, columnIndex:int):*
Returns the value for the cell at columnIndex and rowIndex.
TableModel
  
isCellEditable(rowIndex:int, columnIndex:int):Boolean
Returns true if the cell at rowIndex and columnIndex is editable.
TableModel
  
Removes a listener from the list that is notified each time a change to the data model occurs.
TableModel
  
setValueAt(aValue:*, rowIndex:int, columnIndex:int):void
Sets the value in the cell at columnIndex and rowIndex to aValue.
TableModel
Method detail
addTableModelListener()method
public function addTableModelListener(l:TableModelListener):void

Adds a listener to the list that is notified each time a change to the data model occurs.

Parameters
l:TableModelListener — the TableModelListener
getColumnClass()method 
public function getColumnClass(columnIndex:int):String

Returns the most specific superclass for all the cell values in the column. This is used by the JTable to set up a default renderer and editor for the column.

Parameters
columnIndex:int — the index of the column

Returns
String — the common ancestor class(name) of the object values in the model.
getColumnCount()method 
public function getColumnCount():int

Returns the number of columns in the model. A JTable uses this method to determine how many columns it should create and display by default.

Returns
int — the number of columns in the model

See also

getColumnName()method 
public function getColumnName(columnIndex:int):String

Returns the name of the column at columnIndex. This is used to initialize the table's column header name. Note: this name does not need to be unique; two columns in a table can have the same name.

Parameters
columnIndex:int — the index of the column

Returns
String — the name of the column
getRowCount()method 
public function getRowCount():int

Returns the number of rows in the model. A JTable uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.

Returns
int — the number of rows in the model

See also

getValueAt()method 
public function getValueAt(rowIndex:int, columnIndex:int):*

Returns the value for the cell at columnIndex and rowIndex.

Parameters
rowIndex:int — the row whose value is to be queried
 
columnIndex:int — the column whose value is to be queried

Returns
* — the value Object at the specified cell
isCellEditable()method 
public function isCellEditable(rowIndex:int, columnIndex:int):Boolean

Returns true if the cell at rowIndex and columnIndex is editable. Otherwise, setValueAt on the cell will not change the value of that cell.

Parameters
rowIndex:int — the row whose value to be queried
 
columnIndex:int — the column whose value to be queried

Returns
Boolean — true if the cell is editable

See also

removeTableModelListener()method 
public function removeTableModelListener(l:TableModelListener):void

Removes a listener from the list that is notified each time a change to the data model occurs.

Parameters
l:TableModelListener — the TableModelListener
setValueAt()method 
public function setValueAt(aValue:*, rowIndex:int, columnIndex:int):void

Sets the value in the cell at columnIndex and rowIndex to aValue.

Parameters
aValue:* — the new value
 
rowIndex:int — the row whose value is to be changed
 
columnIndex:int — the column whose value is to be changed

See also