FileDocCategorySizeDatePackage
OldJTable.javaAPI DocSun JDK 1.4.2 Example9291Thu May 12 00:35:28 BST 2005None

OldJTable

public class OldJTable extends JTable
The OldJTable is an unsupported class containing some methods that were deleted from the JTable between releases 0.6 and 0.7

Fields Summary
Constructors Summary
Methods Summary
public javax.swing.table.TableColumnaddColumn(java.lang.Object columnIdentifier, int width)

	return addColumn(columnIdentifier, width, null, null, null);
    
public javax.swing.table.TableColumnaddColumn(int modelColumn, int width)

	return addColumn(modelColumn, width, null, null);
    
public javax.swing.table.TableColumnaddColumn(int modelColumn)

	return addColumn(modelColumn, 75, null, null);
    
public javax.swing.table.TableColumnaddColumn(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.

param
modelColumn The index of the column in the model
param
width The new column's width. Or -1 to use the default width
param
renderer The renderer used with the new column. Or null to use the default renderer.
param
editor The editor used with the new column. Or null to use the default editor.

	TableColumn newColumn = new TableColumn(modelColumn, width, renderer, editor);        
	addColumn(newColumn); 
	return newColumn; 
    
public javax.swing.table.TableColumnaddColumn(java.lang.Object columnIdentifier, java.util.Vector columnData)

	return addColumn(columnIdentifier, -1, null, null, columnData);
    
public javax.swing.table.TableColumnaddColumn(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.TableColumnaddColumn(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 voidaddRow(java.lang.Object[] rowData)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).addRow(rowData);
    
public voidaddRow(java.util.Vector rowData)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).addRow(rowData);
    
protected voidcheckDefaultTableModel()

        if(!(dataModel instanceof DefaultTableModel))
            throw new InternalError("In order to use this method, the data model must be an instance of DefaultTableModel.");
    
public booleaneditColumnRow(java.lang.Object identifier, int row)

	return super.editCellAt(row, getColumnIndex(identifier));
    
public booleaneditColumnRow(int columnIndex, int rowIndex)

	return super.editCellAt(rowIndex, columnIndex);
    
public booleaneditColumnRow(int columnIndex, int rowIndex, java.util.EventObject e)

        return super.editCellAt(rowIndex, columnIndex, e); 
    
public intgetColumnIndex(java.lang.Object identifier)

 
        return getColumnModel().getColumnIndex(identifier); 
    
public java.lang.ObjectgetValueAt(java.lang.Object columnIdentifier, int rowIndex)

	return  super.getValueAt(rowIndex, getColumnIndex(columnIdentifier));
    
public voidinsertRow(int rowIndex, java.lang.Object[] rowData)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).insertRow(rowIndex, rowData);
    
public voidinsertRow(int rowIndex, java.util.Vector rowData)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).insertRow(rowIndex, rowData);
    
public booleanisCellEditable(java.lang.Object columnIdentifier, int rowIndex)

	return  super.isCellEditable(rowIndex, getColumnIndex(columnIdentifier));
    
public booleanisColumnSelected(java.lang.Object identifier)

 
	return isColumnSelected(getColumnIndex(identifier));
    
public voidmoveColumn(java.lang.Object columnIdentifier, java.lang.Object targetColumnIdentifier)

	moveColumn(getColumnIndex(columnIdentifier),
		   getColumnIndex(targetColumnIdentifier));
    
public voidmoveRow(int startIndex, int endIndex, int toIndex)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).moveRow(startIndex, endIndex, toIndex);
    
public voidremoveColumn(java.lang.Object columnIdentifier)

	super.removeColumn(getColumn(columnIdentifier));
    
public voidremoveRow(int rowIndex)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).removeRow(rowIndex);
    
public voidsetDataVector(java.util.Vector newData, java.util.Vector columnIds)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).setDataVector(newData, columnIds);
    
public voidsetDataVector(java.lang.Object[][] newData, java.lang.Object[] columnIds)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).setDataVector(newData, columnIds);
    
public voidsetNumRows(int newSize)

	checkDefaultTableModel();
	((DefaultTableModel)getModel()).setNumRows(newSize);
    
public voidsetValueAt(java.lang.Object aValue, java.lang.Object columnIdentifier, int rowIndex)

	super.setValueAt(aValue, rowIndex, getColumnIndex(columnIdentifier));