public class DefaultTableModel extends AbstractTableModel
| Constructor and Description |
|---|
DefaultTableModel(int rows_,
int columns_)
Constructs a DefaultTableModel with the specified number of
rows and columns, and with cell values of null.
|
DefaultTableModel(java.lang.Object[][] data_,
java.lang.Object[] columnNames_)
Constructs a DefaultTableModel and initialises the table by passing
data_ and columnNames_ to the setDataVector method.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColumnCount()
Get the number of columns in the model.
|
java.lang.String |
getColumnName(int column_)
Get the name of the specified column.
|
int |
getColumnWidth(int column_)
Get the width of the specified column.
|
int |
getRowCount()
Get the number of rows in the model.
|
java.lang.Object |
getValueAt(int rowIndex_,
int columnIndex_)
Returns an attribute value for the cell at (rowIndex, columnIndex)
|
void |
setDataVector(int rows_,
int columns_)
Set up an empty data vector with the specified number of rows
and columns.
|
void |
setDataVector(java.lang.Object[][] data_,
java.lang.Object[] columnNames_)
Replaces the values in the _dataVector instance variable with the
values in the data_ array.
|
void |
setValueAt(java.lang.Object value_,
int row_,
int column_)
Sets the attribute value for the cell at position (row, column).
|
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, removeTableModelListenerpublic DefaultTableModel(int rows_,
int columns_)
public DefaultTableModel(java.lang.Object[][] data_,
java.lang.Object[] columnNames_)
public int getColumnCount()
public java.lang.String getColumnName(int column_)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic int getColumnWidth(int column_)
public int getRowCount()
getRowCount in interface TableModelgetRowCount in class AbstractTableModelpublic java.lang.Object getValueAt(int rowIndex_,
int columnIndex_)
public void setValueAt(java.lang.Object value_,
int row_,
int column_)
setValueAt in interface TableModelsetValueAt in class AbstractTableModelpublic void setDataVector(java.lang.Object[][] data_,
java.lang.Object[] columnNames_)
public void setDataVector(int rows_,
int columns_)