Methods Summary |
---|
public javax.swing.table.TableColumn | addColumn(java.lang.Object columnIdentifier, int width)
return addColumn(columnIdentifier, width, null, null, null);
|
public javax.swing.table.TableColumn | addColumn(int modelColumn, int width)
return addColumn(modelColumn, width, null, null);
|
public javax.swing.table.TableColumn | addColumn(int modelColumn)
return addColumn(modelColumn, 75, null, null);
|
public javax.swing.table.TableColumn | addColumn(int modelColumn, int width, javax.swing.table.TableCellRenderer renderer, javax.swing.table.TableCellEditor editor)Creates a new column with modelColumn, width,
renderer, and editor and adds it to the end of
the JTable's array of columns. This method also retrieves the
name of the column using the model's getColumnName(modelColumn)
method, and sets the both the header value and the identifier
for this TableColumn accordingly.
The modelColumn is the index of the column in the model which
will supply the data for this column in the table. This, like the
columnIdentifier in previous releases, does not change as the
columns are moved in the view.
For the rest of the JTable API, and all of its associated classes,
columns are referred to in the co-ordinate system of the view, the
index of the column in the model is kept inside the TableColumn
and is used only to retrieve the information from the appropraite
column in the model.
TableColumn newColumn = new TableColumn(modelColumn, width, renderer, editor);
addColumn(newColumn);
return newColumn;
|
public javax.swing.table.TableColumn | addColumn(java.lang.Object columnIdentifier, java.util.Vector columnData)
return addColumn(columnIdentifier, -1, null, null, columnData);
|
public javax.swing.table.TableColumn | addColumn(java.lang.Object columnIdentifier, int width, javax.swing.table.TableCellRenderer renderer, javax.swing.table.TableCellEditor editor)
return addColumn(columnIdentifier, width, renderer, editor, null);
|
public javax.swing.table.TableColumn | addColumn(java.lang.Object columnIdentifier, int width, javax.swing.table.TableCellRenderer renderer, javax.swing.table.TableCellEditor editor, java.util.Vector columnData)
checkDefaultTableModel();
// Set up the model side first
DefaultTableModel m = (DefaultTableModel)getModel();
m.addColumn(columnIdentifier, columnData);
// The column will have been added to the end, so the index of the
// column in the model is the last element.
TableColumn newColumn = new TableColumn(m.getColumnCount()-1, width, renderer, editor);
super.addColumn(newColumn);
return newColumn;
|
public void | addRow(java.lang.Object[] rowData)
checkDefaultTableModel();
((DefaultTableModel)getModel()).addRow(rowData);
|
public void | addRow(java.util.Vector rowData)
checkDefaultTableModel();
((DefaultTableModel)getModel()).addRow(rowData);
|
protected void | checkDefaultTableModel()
if(!(dataModel instanceof DefaultTableModel))
throw new InternalError("In order to use this method, the data model must be an instance of DefaultTableModel.");
|
public boolean | editColumnRow(java.lang.Object identifier, int row)
return super.editCellAt(row, getColumnIndex(identifier));
|
public boolean | editColumnRow(int columnIndex, int rowIndex)
return super.editCellAt(rowIndex, columnIndex);
|
public boolean | editColumnRow(int columnIndex, int rowIndex, java.util.EventObject e)
return super.editCellAt(rowIndex, columnIndex, e);
|
public int | getColumnIndex(java.lang.Object identifier)
return getColumnModel().getColumnIndex(identifier);
|
public java.lang.Object | getValueAt(java.lang.Object columnIdentifier, int rowIndex)
return super.getValueAt(rowIndex, getColumnIndex(columnIdentifier));
|
public void | insertRow(int rowIndex, java.lang.Object[] rowData)
checkDefaultTableModel();
((DefaultTableModel)getModel()).insertRow(rowIndex, rowData);
|
public void | insertRow(int rowIndex, java.util.Vector rowData)
checkDefaultTableModel();
((DefaultTableModel)getModel()).insertRow(rowIndex, rowData);
|
public boolean | isCellEditable(java.lang.Object columnIdentifier, int rowIndex)
return super.isCellEditable(rowIndex, getColumnIndex(columnIdentifier));
|
public boolean | isColumnSelected(java.lang.Object identifier)
return isColumnSelected(getColumnIndex(identifier));
|
public void | moveColumn(java.lang.Object columnIdentifier, java.lang.Object targetColumnIdentifier)
moveColumn(getColumnIndex(columnIdentifier),
getColumnIndex(targetColumnIdentifier));
|
public void | moveRow(int startIndex, int endIndex, int toIndex)
checkDefaultTableModel();
((DefaultTableModel)getModel()).moveRow(startIndex, endIndex, toIndex);
|
public void | removeColumn(java.lang.Object columnIdentifier)
super.removeColumn(getColumn(columnIdentifier));
|
public void | removeRow(int rowIndex)
checkDefaultTableModel();
((DefaultTableModel)getModel()).removeRow(rowIndex);
|
public void | setDataVector(java.util.Vector newData, java.util.Vector columnIds)
checkDefaultTableModel();
((DefaultTableModel)getModel()).setDataVector(newData, columnIds);
|
public void | setDataVector(java.lang.Object[][] newData, java.lang.Object[] columnIds)
checkDefaultTableModel();
((DefaultTableModel)getModel()).setDataVector(newData, columnIds);
|
public void | setNumRows(int newSize)
checkDefaultTableModel();
((DefaultTableModel)getModel()).setNumRows(newSize);
|
public void | setValueAt(java.lang.Object aValue, java.lang.Object columnIdentifier, int rowIndex)
super.setValueAt(aValue, rowIndex, getColumnIndex(columnIdentifier));
|