charvax.swing.table
Class AbstractTableModel
java.lang.Object
charvax.swing.table.AbstractTableModel
- TableModel
public abstract class AbstractTableModel
extends java.lang.Object
This abstract class provides default implementations for most of the methods
in the TableModel class. It takes care of the management of listeners, and
provides some convenience methods for generating TableModeEvents and
dispatching them to the listeners. To implement a concrete TableModel as a
subclass of AbstractTableModel, you only need to provide implementations of
the following methods:
public int getRowCount();
public int getColumnCount();
public Object getValueAt(int row, int column);
void | addTableModelListener(TableModelListener l) - Adds a listener that will be notified each time the data model
changes.
|
void | fireTableCellUpdated(int row_, int column_) - Notifies all listeners that the value at [row, column] has been
updated.
|
void | fireTableChanged(TableModelEvent evt_) - Forwards the specified event to all TableModelListeners that
registered themselves as listeners for this TableModel.
|
void | fireTableDataChanged() - Notifies all listeners that all cell values in the table may have
changed.
|
void | fireTableRowsDeleted(int firstRow_, int lastRow_) - Notifies all listeners that rows in the range [firstRow_, lastRow_],
inclusive, have been deleted.
|
void | fireTableRowsInserted(int firstRow_, int lastRow_) - Notifies all listeners that rows in the range [firstRow_, lastRow_],
inclusive, have been inserted.
|
String | getColumnName(int column_) - Returns a default name for the column using spreadsheet conventions: A,
B, C...
|
abstract int | getRowCount() - Get the number of rows in the model.
|
void | removeTableModelListener(TableModelListener l) - Removes the specified listener from the list of listeners.
|
void | setValueAt(Object value_, int row_, int column_) - This empty implementation is provided so that users don't have to
provide their own implementation if their table is not editable.
|
fireTableCellUpdated
public void fireTableCellUpdated(int row_,
int column_)
Notifies all listeners that the value at [row, column] has been
updated.
fireTableChanged
public void fireTableChanged(TableModelEvent evt_)
Forwards the specified event to all TableModelListeners that
registered themselves as listeners for this TableModel.
- fireTableChanged in interface TableModel
fireTableDataChanged
public void fireTableDataChanged()
Notifies all listeners that all cell values in the table may have
changed.
fireTableRowsDeleted
public void fireTableRowsDeleted(int firstRow_,
int lastRow_)
Notifies all listeners that rows in the range [firstRow_, lastRow_],
inclusive, have been deleted.
fireTableRowsInserted
public void fireTableRowsInserted(int firstRow_,
int lastRow_)
Notifies all listeners that rows in the range [firstRow_, lastRow_],
inclusive, have been inserted.
getColumnName
public String getColumnName(int column_)
Returns a default name for the column using spreadsheet conventions: A,
B, C...
- getColumnName in interface TableModel
getRowCount
public abstract int getRowCount()
Get the number of rows in the model.
- getRowCount in interface TableModel
setValueAt
public void setValueAt(Object value_,
int row_,
int column_)
This empty implementation is provided so that users don't have to
provide their own implementation if their table is not editable.
- setValueAt in interface TableModel