API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.table. DefaultTableModel View Source
Author(s)
Philip Milne
Since
Version
1.43 04/07/06
Serial
Hierarchy
 Object
      AbstractTableModel
          DefaultTableModel
Implements
 Serializable
Subclasses
Description
public class DefaultTableModel
  This is an implementation of TableModel that uses a Vector of Vectors to store the cell value objects.
Constructors
public DefaultTableModel ()
Constructs a default DefaultTableModel which is a table of zero columns and zero rows.
public DefaultTableModel (int rowCount, int columnCount)
  Constructs a DefaultTableModel with rowCount and columnCount of null object values.
public DefaultTableModel (Object data, Object columnNames)
  Constructs a DefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method.
public DefaultTableModel (Object columnNames, int rowCount)
  Constructs a DefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values.
public DefaultTableModel (Vector columnNames, int rowCount)
  Constructs a DefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values.
public DefaultTableModel (Vector data, Vector columnNames)
  Constructs a DefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method.
Methods
Hide/Show inherited methods
public void addColumn (Object columnName)
  Adds a column to the model.
public void addColumn (Object columnName, Object columnData)
  Adds a column to the model.
public void addColumn (Object columnName, Vector columnData)
  Adds a column to the model.
public void addRow (Object rowData)
  Adds a row to the end of the model.
public void addRow (Vector rowData)
  Adds a row to the end of the model.
public void addTableModelListener (TableModelListener l) [Inherited From AbstractTableModel]
  Adds a listener to the list that's notified each time a change to the data model occurs.
protectedstatic Vector convertToVector (Object anArray)
  Returns a vector that contains the same objects as the array.
protectedstatic Vector convertToVector (Object anArray)
  Returns a vector of vectors that contains the same objects as the array.
public int findColumn (String columnName) [Inherited From AbstractTableModel]
  Returns a column given its name.
public void fireTableCellUpdated (int row, int column) [Inherited From AbstractTableModel]
  Notifies all listeners that the value of the cell at [row, column] has been updated.
public void fireTableChanged (TableModelEvent e) [Inherited From AbstractTableModel]
  Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model.
public void fireTableDataChanged () [Inherited From AbstractTableModel]
  Notifies all listeners that all cell values in the table's rows may have changed.
public void fireTableRowsDeleted (int firstRow, int lastRow) [Inherited From AbstractTableModel]
  Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been deleted.
public void fireTableRowsInserted (int firstRow, int lastRow) [Inherited From AbstractTableModel]
  Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been inserted.
public void fireTableRowsUpdated (int firstRow, int lastRow) [Inherited From AbstractTableModel]
  Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been updated.
public void fireTableStructureChanged () [Inherited From AbstractTableModel]
  Notifies all listeners that the table's structure has changed.
public Class<Object> getColumnClass (int columnIndex) [Inherited From AbstractTableModel]
  Returns Object.class regardless of columnIndex.
public int getColumnCount ()
  Returns the number of columns in this data table.
public String getColumnName (int column) [Overrides AbstractTableModel]
  Returns the column name.
public Vector getDataVector ()
  Returns the Vector of Vectors that contains the table's data values.
public T getListeners (Class< T> listenerType) [Inherited From AbstractTableModel]
  Returns an array of all the objects currently registered as FooListeners upon this AbstractTableModel.
public int getRowCount ()
  Returns the number of rows in this data table.
public TableModelListener getTableModelListeners () [Inherited From AbstractTableModel]
  Returns an array of all the table model listeners registered on this model.
public Object getValueAt (int row, int column)
  Returns an attribute value for the cell at row and column.
public void insertRow (int row, Object rowData)
  Inserts a row at row in the model.
public void insertRow (int row, Vector rowData)
  Inserts a row at row in the model.
public boolean isCellEditable (int row, int column) [Overrides AbstractTableModel]
  Returns true regardless of parameter values.
public void moveRow (int start, int end, int to)
  Moves one or more rows from the inclusive range start to end to the to position in the model.
public void newDataAvailable (TableModelEvent event)
  Equivalent to fireTableChanged.
public void newRowsAdded (TableModelEvent e)
  Ensures that the new rows have the correct number of columns.
public void removeRow (int row)
  Removes the row at row from the model.
public void removeTableModelListener (TableModelListener l) [Inherited From AbstractTableModel]
  Removes a listener from the list that's notified each time a change to the data model occurs.
public void rowsRemoved (TableModelEvent event)
  Equivalent to fireTableChanged.
public void setColumnCount (int columnCount)
  Sets the number of columns in the model.
public void setColumnIdentifiers (Object newIdentifiers)
  Replaces the column identifiers in the model.
public void setColumnIdentifiers (Vector columnIdentifiers)
  Replaces the column identifiers in the model.
public void setDataVector (Object dataVector, Object columnIdentifiers)
  Replaces the value in the dataVector instance variable with the values in the array dataVector.
public void setDataVector (Vector dataVector, Vector columnIdentifiers)
  Replaces the current dataVector instance variable with the new Vector of rows, dataVector.
public void setNumRows (int rowCount)
  Obsolete as of Java 2 platform v1.3.
public void setRowCount (int rowCount)
  Sets the number of rows in the model.
public void setValueAt (Object aValue, int row, int column) [Overrides AbstractTableModel]
  Sets the object value for the cell at column and row.
Fields
Hide/Show inherited fields
protected Vector columnIdentifiers
The Vector of column identifiers.
protected Vector dataVector
The Vector of Vectors of Object values.
protected EventListenerList listenerList [Inherited From AbstractTableModel]
List of listeners
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar