Java javax.swing.table DefaultTableModel fields, constructors, methods, implement or subclass

Example usage for Java javax.swing.table DefaultTableModel fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing.table DefaultTableModel.

The text is from its open source code.

Subclass

javax.swing.table.DefaultTableModel has subclasses.
Click this link to see all its subclasses.

Constructor

DefaultTableModel()
Constructs a default DefaultTableModel which is a table of zero columns and zero rows.
DefaultTableModel(int rowCount, int columnCount)
Constructs a DefaultTableModel with rowCount and columnCount of null object values.
DefaultTableModel(Vector columnNames, int rowCount)
Constructs a DefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values.
DefaultTableModel(Object[] columnNames, int rowCount)
Constructs a DefaultTableModel with as many columns as there are elements in columnNames and rowCount of null object values.
DefaultTableModel(Vector data, Vector columnNames)
Constructs a DefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method.
DefaultTableModel(Object[][] data, Object[] columnNames)
Constructs a DefaultTableModel and initializes the table by passing data and columnNames to the setDataVector method.

Method

voidaddColumn(Object columnName)
Adds a column to the model.
voidaddColumn(Object columnName, Vector columnData)
Adds a column to the model.
voidaddColumn(Object columnName, Object[] columnData)
Adds a column to the model.
voidaddRow(Vector rowData)
Adds a row to the end of the model.
voidaddRow(Object[] rowData)
Adds a row to the end of the model.
voidaddTableModelListener(TableModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.
intfindColumn(String columnName)
Returns a column given its name.
voidfireTableCellUpdated(int row, int column)
Notifies all listeners that the value of the cell at [row, column] has been updated.
voidfireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed.
voidfireTableRowsDeleted(int firstRow, int lastRow)
Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been deleted.
voidfireTableStructureChanged()
Notifies all listeners that the table's structure has changed.
ClassgetColumnClass(int columnIndex)
Returns Object.class regardless of columnIndex.
intgetColumnCount()
Returns the number of columns in this data table.
StringgetColumnName(int column)
Returns the column name.
VectorgetDataVector()
Returns the Vector of Vectors that contains the table's data values.
intgetRowCount()
Returns the number of rows in this data table.
ObjectgetValueAt(int row, int column)
Returns an attribute value for the cell at row and column.
voidinsertRow(int row, Vector rowData)
Inserts a row at row in the model.
voidinsertRow(int row, Object[] rowData)
Inserts a row at row in the model.
voidmoveRow(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.
voidremoveRow(int row)
Removes the row at row from the model.
voidsetColumnCount(int columnCount)
Sets the number of columns in the model.
voidsetColumnIdentifiers(Vector columnIdentifiers)
Replaces the column identifiers in the model.
voidsetColumnIdentifiers(Object[] newIdentifiers)
Replaces the column identifiers in the model.
voidsetDataVector(Vector dataVector, Vector columnIdentifiers)
Replaces the current dataVector instance variable with the new Vector of rows, dataVector.
voidsetDataVector(Object[][] dataVector, Object[] columnIdentifiers)
Replaces the value in the dataVector instance variable with the values in the array dataVector.
voidsetNumRows(int rowCount)
Obsolete as of Java 2 platform v1.3.
voidsetRowCount(int rowCount)
Sets the number of rows in the model.
voidsetValueAt(Object aValue, int row, int column)
Sets the object value for the cell at column and row.