|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object charvax.swing.table.AbstractTableModel
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);
Constructor Summary | |
AbstractTableModel()
|
Method Summary | |
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. |
java.lang.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(java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface charvax.swing.table.TableModel |
getColumnCount, getValueAt |
Constructor Detail |
public AbstractTableModel()
Method Detail |
public void addTableModelListener(TableModelListener l)
addTableModelListener
in interface TableModel
public void removeTableModelListener(TableModelListener l)
removeTableModelListener
in interface TableModel
public java.lang.String getColumnName(int column_)
getColumnName
in interface TableModel
public void setValueAt(java.lang.Object value_, int row_, int column_)
setValueAt
in interface TableModel
public void fireTableChanged(TableModelEvent evt_)
fireTableChanged
in interface TableModel
public void fireTableCellUpdated(int row_, int column_)
public void fireTableDataChanged()
public void fireTableRowsDeleted(int firstRow_, int lastRow_)
public void fireTableRowsInserted(int firstRow_, int lastRow_)
public abstract int getRowCount()
getRowCount
in interface TableModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |