javax.swing.table
public abstract class AbstractTableModel extends Object implements TableModel, Serializable
Field Summary | |
---|---|
protected EventListenerList | listenerList
Storage for the listeners registered with this model. |
Constructor Summary | |
---|---|
AbstractTableModel()
Creates a default instance. |
Method Summary | |
---|---|
void | addTableModelListener(TableModelListener listener)
Adds a listener to the table model. |
int | findColumn(String columnName)
Return the index of the specified column, or -1 if there is
no column with the specified name.
|
void | fireTableCellUpdated(int row, int column)
Sends a {@link TableModelEvent} to all registered listeners to inform
them that a single cell has been updated.
|
void | fireTableChanged(TableModelEvent event)
Sends the specified event to all registered listeners.
|
void | fireTableDataChanged()
Sends a {@link TableModelEvent} to all registered listeners to inform
them that the table data has changed. |
void | fireTableRowsDeleted(int firstRow, int lastRow)
Sends a {@link TableModelEvent} to all registered listeners to inform
them that some rows have been deleted from the model.
|
void | fireTableRowsInserted(int firstRow, int lastRow)
Sends a {@link TableModelEvent} to all registered listeners to inform
them that some rows have been inserted into the model.
|
void | fireTableRowsUpdated(int firstRow, int lastRow)
Sends a {@link TableModelEvent} to all registered listeners to inform
them that some rows have been updated.
|
void | fireTableStructureChanged()
Sends a {@link TableModelEvent} to all registered listeners to inform
them that the table structure has changed. |
Class<?> | getColumnClass(int columnIndex)
Returns the Class for all Object instances
in the specified column.
|
String | getColumnName(int columnIndex)
Returns the name of the specified column. |
<T extends EventListener> T[] | getListeners(Class<T> listenerType)
Returns an array of listeners of the given type that are registered with
this model.
|
TableModelListener[] | getTableModelListeners()
Returns an array containing the listeners that have been added to the
table model.
|
boolean | isCellEditable(int rowIndex, int columnIndex)
Returns true if the specified cell is editable, and
false if it is not. |
void | removeTableModelListener(TableModelListener listener)
Removes a listener from the table model so that it will no longer receive
notification of changes to the table model.
|
void | setValueAt(Object value, int rowIndex, int columnIndex)
Sets the value of the given cell. |
Parameters: listener the listener.
-1
if there is
no column with the specified name.
Parameters: columnName the name of the column (null
not permitted).
Returns: The index of the column, -1 if not found.
Throws: NullPointerException if columnName
is
null
.
See Also: AbstractTableModel
Parameters: row the row index. column the column index.
Parameters: event the event to send.
Parameters: firstRow the index of the first row. lastRow the index of the last row.
Parameters: firstRow the index of the first row. lastRow the index of the last row.
Parameters: firstRow the index of the first row. lastRow the index of the last row.
Class
for all Object
instances
in the specified column.
Parameters: columnIndex the column index.
Returns: The class.
Parameters: columnIndex the column index.
Returns: The name of the column.
Parameters: listenerType the listener class.
Returns: An array of listeners (possibly empty).
Returns: Array of {@link TableModelListener} objects.
Since: 1.4
true
if the specified cell is editable, and
false
if it is not. This implementation returns
false
for all arguments, subclasses should override the
method if necessary.
Parameters: rowIndex the row index of the cell. columnIndex the column index of the cell.
Returns: false
.
Parameters: listener the listener to remove.
Parameters: value the new value (null
permitted). rowIndex the row index of the cell. columnIndex the column index of the cell.