All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sun.java.swing.table.TableDataModel

public interface TableDataModel
The TableDataModel interface specifies the interface for objects that provides data for cells in a JTable.

See Also:
JTable

Method Index

 o addTableModelListener(TableModelListener)
Add a listener to the list that's notified each time a change to the data model occurs.
 o getRowCount()
Returns the number of records managed by the data source object.
 o getValueAt(Object, int)
Returns an attribute value for the record in the column with the unique identifier columnIdentifier at rowIndex.
 o removeTableModelListener(TableModelListener)
Remove a listener from the list that's notified each time a change to the data model occurs.
 o setValueAt(Object, Object, int)
Sets an attribute value for the record in the column with the unique identifier ColumnIdentifier at rowIndex.

Methods

 o getRowCount
 public abstract int getRowCount()
Returns the number of records managed by the data source object. A JTable uses this method to determine how many rows it should create and display. This method should be quick, as it is call by JTable quite frequently.

 o getValueAt
 public abstract Object getValueAt(Object columnIdentifier,
                                   int rowIndex)
Returns an attribute value for the record in the column with the unique identifier columnIdentifier at rowIndex.

Parameters:
columnIdentifier - the column whose value is to be looked up
rowIndex - the row whose value is to be looked up
 o setValueAt
 public abstract void setValueAt(Object aValue,
                                 Object columnIdentifier,
                                 int rowIndex)
Sets an attribute value for the record in the column with the unique identifier ColumnIdentifier at rowIndex. aValue is the new value.

Parameters:
aValue - the new value
columnIdentifier - the column whose value is to be changed
rowIndex - the row whose value is to be changed
 o addTableModelListener
 public abstract void addTableModelListener(TableModelListener l)
Add a listener to the list that's notified each time a change to the data model occurs.

Parameters:
l - the TableModelListener
 o removeTableModelListener
 public abstract void removeTableModelListener(TableModelListener l)
Remove a listener from the list that's notified each time a change to the data model occurs.

Parameters:
l - the TableModelListener

All Packages  Class Hierarchy  This Package  Previous  Next  Index