charvax.swing.table
Class DefaultTableModel
- TableModel
public class DefaultTableModel
This is an implementation of the TableModel interface that uses a
Vector of Vectors to store the cell values.
DefaultTableModel(Object[][] data_, Object[] columnNames_) - Constructs a DefaultTableModel and initialises the table by passing
data_ and columnNames_ to the setDataVector method.
|
DefaultTableModel(int rows_, int columns_) - Constructs a DefaultTableModel with the specified number of
rows and columns, and with cell values of null.
|
int | getColumnCount() - Get the number of columns in the model.
|
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.
|
Object | getValueAt(int rowIndex_, int columnIndex_) - Returns an attribute value for the cell at (rowIndex, columnIndex)
|
void | setDataVector(Object[][] data_, Object[] columnNames_) - Replaces the values in the _dataVector instance variable with the
values in the data_ array.
|
void | setDataVector(int rows_, int columns_) - Set up an empty data vector with the specified number of rows
and columns.
|
void | setValueAt(Object value_, int row_, int column_) - Sets the attribute value for the cell at position (row, column).
|
DefaultTableModel
public DefaultTableModel(Object[][] data_,
Object[] columnNames_)
Constructs a DefaultTableModel and initialises the table by passing
data_ and columnNames_ to the setDataVector method.
DefaultTableModel
public DefaultTableModel(int rows_,
int columns_)
Constructs a DefaultTableModel with the specified number of
rows and columns, and with cell values of null.
getColumnCount
public int getColumnCount()
Get the number of columns in the model.
- getColumnCount in interface TableModel
getColumnWidth
public int getColumnWidth(int column_)
Get the width of the specified column.
getValueAt
public Object getValueAt(int rowIndex_,
int columnIndex_)
Returns an attribute value for the cell at (rowIndex, columnIndex)
- getValueAt in interface TableModel
setDataVector
public void setDataVector(Object[][] data_,
Object[] columnNames_)
Replaces the values in the _dataVector instance variable with the
values in the data_ array. The first index is the row index, the
second index is the column index.
The columnNames_ array supplies the new column names.
setDataVector
public void setDataVector(int rows_,
int columns_)
Set up an empty data vector with the specified number of rows
and columns.