public class SwingTableModel extends DefaultTableModel
DefaultTableModel
by the possibility to specify
column types and column editable flags.columnIdentifiers, dataVector
listenerList
Constructor and Description |
---|
SwingTableModel()
Constructs a default
SwingTableModel that has zero
columns and rows. |
SwingTableModel(Object[][] data,
Object[] columnNames)
Constructs a
SwingTableModel and initializes it with the
specified data and column names. |
SwingTableModel(SwingTableModel model)
Copy constructor.
|
SwingTableModel(Vector<? extends Vector> data,
Vector<String> columnNames)
Constructs a
SwingTableModel and initializes it with the
specified data and column names. |
SwingTableModel(Vector<? extends Vector> data,
Vector<String> columnNames,
Vector<Class<?>> columnTypes,
Vector<Boolean> columnEditables)
Constructs a
SwingTableModel and initializes it with the
specified data, column names, column types and column editable flags. |
SwingTableModel(Vector<? extends Vector> data,
Vector<String> columnNames,
Vector<Class<?>> columnTypes,
Vector<Boolean> columnEditables,
Vector<SwingTableColumn> columnInfos)
Constructs a
SwingTableModel and initializes it with the
specified data, column names, column types, column editable flags
and additional column infos. |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getColumnClass(int columnIndex)
Returns the type of the data in the specified column.
|
Vector<Boolean> |
getColumnEditables()
Returns the
Vector that contains the table's column editable flags. |
SwingTableColumn |
getColumnInfo(int column)
Returns the column info for the given column index.
|
Vector<SwingTableColumn> |
getColumnInfos()
Returns the
Vector that contains the table's column infos. |
Vector<String> |
getColumnNames()
Returns the
Vector that contains the table's column names. |
Vector<Class<?>> |
getColumnTypes()
Returns the
Vector that contains the table's column types. |
boolean |
isCellEditable(int row,
int column)
Returns
true if the specified column is editable. |
boolean |
isColumnEditable(int column)
Returns
true if the cells in the specified column are editable. |
void |
setColumnCount(int columnCount)
Sets the number of columns in the model.
|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public SwingTableModel()
SwingTableModel
that has zero
columns and rows.public SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames)
SwingTableModel
and initializes it with the
specified data and column names.
See DefaultTableModel
for details.
public SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames, Vector<Class<?>> columnTypes, Vector<Boolean> columnEditables)
SwingTableModel
and initializes it with the
specified data, column names, column types and column editable flags.
See DefaultTableModel
for details.
public SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames, Vector<Class<?>> columnTypes, Vector<Boolean> columnEditables, Vector<SwingTableColumn> columnInfos)
SwingTableModel
and initializes it with the
specified data, column names, column types, column editable flags
and additional column infos.
See DefaultTableModel
for details.
public SwingTableModel(Object[][] data, Object[] columnNames)
SwingTableModel
and initializes it with the
specified data and column names.
See DefaultTableModel
for details.
public SwingTableModel(SwingTableModel model)
public Vector<String> getColumnNames()
Vector
that contains the table's column names.
Each element in the vector must be a java.lang.String
.public Vector<Class<?>> getColumnTypes()
Vector
that contains the table's column types.
Each element in the vector must be a java.lang.Class
.public Vector<Boolean> getColumnEditables()
Vector
that contains the table's column editable flags.
Each element in the vector must be a java.lang.Boolean
.public Vector<SwingTableColumn> getColumnInfos()
Vector
that contains the table's column infos.
Each element in the vector must be a SwingTableColumn
.public void setColumnCount(int columnCount)
See DefaultTableModel.setColumnCount(int)
for details.
setColumnCount
in class DefaultTableModel
public boolean isColumnEditable(int column)
true
if the cells in the specified column are editable.public SwingTableColumn getColumnInfo(int column)
public Class<?> getColumnClass(int columnIndex)
See TableModel.getColumnClass(int)
for details.
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
getColumnTypes()
public boolean isCellEditable(int row, int column)
true
if the specified column is editable.
See TableModel.isCellEditable(int, int)
for details.
isCellEditable
in interface TableModel
isCellEditable
in class DefaultTableModel
isColumnEditable(int)
,
getColumnEditables()
Copyright (C) 2004-2019 FormDev Software GmbH. All rights reserved.