Generated by
JDiff

javax.swing.table Documentation Differences

This file contains all the changes in documentation in the package javax.swing.table as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class AbstractTableModel

This abstract class provides default implementations for most of the methods in the TableModel interface. It takes care of the management of listeners and provides some conveniences for generating TableModelEvents and dispatching them to the listeners. To create a concrete TableModel as a sublcasssubclass of AbstractTableModel you need only provide implementations for the following three methods:
 public int getRowCount(); public int getColumnCount(); public Object getValueAt(int row int column); 

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.28 0238 12/0203/0001 @author Alan Chung @author Philip Milne

Class AbstractTableModel, void fireTableDataChanged()

Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and the JTable should redraw the table from scratch. The structure of the table (as in the order of the columns) is assumed to be the same. @see TableModelEvent @see EventListenerList @see javax.swing.JTable#tableChanged(TableModelEvent)
Class AbstractTableModel, EventListener[] getListeners(Class)

Returns an array of all the objects currently registered as FooListeners upon this AbstractTableModel. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal such as FooListener.class. For example you can query a model m for its table model listeners ofwith the givenfollowing typecode: that

TableModelListener[] tmls = (TableModelListener[])(m.getListeners(TableModelListener.class));
were added toIf no such listeners exist this modelmethod returns an empty array. @returnsparam alllistenerType the type of thelisteners requested; this parameter should specify an interface that descends from java.util.EventListener @return an array of all objects receivingregistered as FooListeners on this component or an empty array if no such listeners have been added @exception ClassCastException if listenerType notificationsdoesn't from thisspecify a modelclass or interface that implements java.util.EventListener @see #getTableModelListeners @since 1.3

Class DefaultTableCellRenderer

The standard class for rendering (displaying) individual cells in a JTable.

Implementation Note: This class inherits from JLabel a standard component class. However JTable employs a unique mechanism for rendering its cells and therefore requires some slightly modified behavior from its cell renderer. The table class defines a single cell renderer and uses it as a as a rubber-stamp for rendering all cells in the table; it renders the first cell changes the contents of that cell renderer shifts the origin to the new location re-draws it and so on. The standard JLabel component was not designed to be used this way and we want to avoid triggering a revalidate each time the cell is drawn. This would greatly decrease performance because the revalidate message would be passed up the hierarchy of the container to determine whether any other components would be affected. So this class overrides the validate revalidate repaint and firePropertyChange methods to be no-ops. If you write your own renderer please keep this performance consideration in mind.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.25 0231 12/0203/0001 @author Philip Milne @see JTable


Class DefaultTableCellRenderer.UIResource

A subclass of DefaultTableCellRenderer that implements UIResource. DefaultTableCellRenderer doesn't implement UIResource directly so that applications can safely override the cellRenderer property with DefaultTableCellRenderer subclasses.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future releaseAs of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder


Class DefaultTableCellRenderer, boolean isOpaque()

Returns true ifOverridden for performance this component is completely opaque. An opaque component paints every pixel within its rectangular boundsreasons. A non-opaque component paintsSee only a subset of its pixels or none at all allowing the pixels underneath it to "show through". Therefore aImplementation componentNote that doesfor more not fully paint its pixels provides a degree of transparency. Subclasses that guarantee to always completely paint their contents should override this method and return trueinformation. @return true if this component is completely opaque @see #setOpaque
Class DefaultTableCellRenderer, void setBackground(Color)

Overrides JComponent.setForegroundsetBackground to assign the unselected-background color to the specified color. @param c set the background color to this value
Class DefaultTableCellRenderer, void setValue(Object)

Sets the stringString object for the cell being rendered to value. @param value the string value for this cell; if value is null it sets the text value to an empty string @see JLabel#setText

Class DefaultTableColumnModel

The standard column-handler for a JTable.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.35 0243 12/0203/0001 @author Alan Chung @author Philip Milne @see JTable

Class DefaultTableColumnModel, int getColumnIndexAtX(int)

Returns the index of the column that lies at position x or -1 if no column covers this point. In keeping with Swing's separable model architecture a TableColumnModel does not know how the table columns actually appear on screen. The visual presentation of the columns is the responsibility of the view/controller object using this model (typically JTable). The view/controller need not display the columns sequentially from left to right. For example columns could be displayed from right to left to accomodate a locale preference or some columns might be hidden at the request of the user. Because the model does not know how the columns are laid out on screen the given xPosition should not be considered to be a coordinate in 2D graphics space. Instead it should be considered to be a width from the start of the first column in the model. If the column index for a given X coordinate in 2D space is required JTable.columnAtPoint can be used instead. @param x the horizontal location of interest @return the index of the column or -1 if no column is found @see javax.swing.JTable#columnAtPoint
Class DefaultTableColumnModel, EventListener[] getListeners(Class)

Returns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal such as FooListener.class. For example you can query a DefaultTableColumnModel m for its column model listeners ofwith the givenfollowing typecode: that

ColumnModelListener[] cmls = (ColumnModelListener[])(m.getListeners(ColumnModelListener.class));
were added toIf no such listeners exist this modelmethod returns an empty array. @param listenerType the listenertype classof listeners requested; this parameter should specify an interface tothat descends from matchjava.util.EventListener @return allan array of theall objects receivingregistered as listenerTypeFooListener notificationss fromon this model or an empty array if no such listeners have been added @exception ClassCastException if listenerType doesn't specify a class or interface that implements java.util.EventListener @see #getColumnModelListeners @since 1.3

Class DefaultTableModel

This is an implementation of TableModel that uses a Vector of Vectors to store the cell value objects.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.27 0234 12/0203/00 @author Alan Chung01 @author Philip Milne @see TableModel @see #getDataVector

Class DefaultTableModel, constructor DefaultTableModel(Object[], int)

Constructs a DefaultTableModel with as many columns as there are elements in columnNames and numRowsrowCount of null object values. Each column's name will be taken from the columnNames array. @param columnNames array containing the names of the new columns.; Ifif this is null then the model has no columns @param numRowsrowCount the number of rows the table holds @see #setDataVector @see #setValueAt
Class DefaultTableModel, constructor DefaultTableModel(Vector, int)

Constructs a DefaultTableModel with as many columns as there are elements in columnNames and numRowsrowCount of null object values. Each column's name will be taken from the columnNames vector. @param columnNames vector containing the names of the new columns.; Ifif this is null then the model has no columns @param numRowsrowCount the number of rows the table holds @see #setDataVector @see #setValueAt
Class DefaultTableModel, constructor DefaultTableModel(int, int)

Constructs a DefaultTableModel with numRowsrowCount and numColumnscolumnCount of null object values. @param numRowsrowCount the number of rows the table holds @param numColumnscolumnCount the number of columns the table holds @see #setValueAt
Class DefaultTableModel, void addColumn(Object)

Adds a column to the model. The new column will have the identifier columnName which may be null. This method will send a tableChanged notification message to all the listeners. This method is a cover for addColumn(Object Vector) which uses null as the data vector. @param columnName the identifier of the column being added @exception IllegalArgumentException if columnName is null
Class DefaultTableModel, void addColumn(Object, Vector)

Adds a column to the model. The new column will have the identifier columnName which may be null. columnData is the optional vector of data for the column. If it is null the column is filled with null values. Otherwise the new data will be added to model starting with the first element going to row 0 etc. This method will send a tableChanged notification message to all the listeners. @param columnName the identifier of the column being added @param columnData optional data of the column being added @exception IllegalArgumentException if columnName is null
Class DefaultTableModel, String getColumnName(int)

Returns the column name. @return a name for this column using the string value of the appropriate member in columnIdentifiers. If columnIdentifiers is null or does not have an entry for this index returns the default name provided by the superclass
Class DefaultTableModel, void moveRow(int, int, int)

Moves one or more rows startingfrom atthe inlcusive range start to startIndexend to the endIndexto position in the model. toAfter the move the row that was at index start will be at index toIndexto. This method will send a tableChanged notification message to all the listeners.

 Examples of moves: 

1. moveRow(1 3 5); a|B|C|D|e|f|g|h|i|j|k - before a|e|f|g|h|B|C|D|g|h|i|j|k - after

2. moveRow(6 7 1); a|b|c|d|e|f|G|H|i|j|k - before a|G|H|b|c|d|e|f|i|j|k - after

@param startIndexstart the starting row index to be moved @param endIndexend the ending row index to be moved @param toIndexto the destination of the rows to be moved @exception ArrayIndexOutOfBoundsException if any of the indices areelements out of range;would or ifbe moved endIndexout is lessof the thantable's startIndexrange
Class DefaultTableModel, void newRowsAdded(TableModelEvent)

Ensures that the new rows have the correct number of columns. This is accomplished by using the setSize method in Vector which truncates vectors which are too long and appends nulls if they are too short. This method also sends out a tableChanged notification message to all the listeners. @param evente this TableModelEvent describes where the rows were added. If null it assumes all the rows were newly added @see #getDataVector
Class DefaultTableModel, void setDataVector(Object[][], Object[])

Replaces the value in the dataVector instance variable with the values in the array newDatadataVector. The first index in the Object[][] array is the row index and the second is the column index. columnNamescolumnIdentifiers are the names of the new columns. @param newDatadataVector the new data vector @param columnNamescolumnIdentifiers the names of the columns @see #setDataVector(Vector Vector)
Class DefaultTableModel, void setDataVector(Vector, Vector)

Replaces the current dataVector instance variable with the new Vector of rows newDatadataVector. columnNamescolumnIdentifiers are the names of the new columns. The first name in columnNamescolumnIdentifiers is mapped to column 0 in newDatadataVector. Each row in newDatadataVector is adjusted to match the number of columns in columnNamescolumnIdentifiers either by truncating the Vector if it is too long or adding null values if it is too short.

Note that passing in a null value for dataVector results in unspecified behavior an possibly an exception. @param newDatadataVector the new data vector @param columnNamescolumnIdentifiers the names of the columns @see #newDataAvailable @see #getDataVector


Class JTableHeader

This is the object which manages the header of the JTable.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.55 0461 12/0603/0001 @author Alan Chung @author Philip Milne @see javax.swing.JTable


Class JTableHeader.AccessibleJTableHeader

This class implements accessibility support for the JTableHeader class. It provides an implementation of the Java Accessibility API appropriate to table header user-interface elements.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder


Class JTableHeader, void columnAdded(TableColumnModelEvent)

Invoked when a column is added to the table column model.

Application code will not use these methods explicitly they are used internally by JtableJTable. @param e the event received @see TableColumnModelListener

Class JTableHeader, TableCellRenderer createDefaultRenderer()

Returns a default renderer to be used when no header renderer is defined by a TableColumn. @paramreturn default renderer to be used when therethe is no headerdefault table column renderer
Class JTableHeader, TableColumn getResizingColumn()

Returns the resizing column. If no column is being resized this method returns null. @return the resizing column if a resize is in process otherwise returns null
Class JTableHeader, void setDefaultRenderer(TableCellRenderer)

Sets the default renderer to be used when no headerRenderer is defined by a TabelColumnTableColumn. @param defaultRenderer the default renderer
Class JTableHeader, void setDraggedColumn(TableColumn)

Sets the header's draggedColumn to aColumn.

Application code will not use this method explicitly it is used internally by the column dragging mechanism. @param aColumn the new value forcolumn being dragged draggedColumnor null if no column is being dragged

Class JTableHeader, void setResizingColumn(TableColumn)

Sets the header's resizingColumn to aColumn.

Application code will not use this method explicitly it is used internally by the column sizing mechanism. @param aColumn the column being resized or null if no column is being resized


Class TableCellEditor

This interface defines the method any object that would like to be an editor of values for components such as JListBox JComboBox JTree or JTable needs to implement. @version 1.13 0214 12/0203/0001 @author Alan Chung

Class TableCellRenderer

This interface defines the method required by any object that would like to be a renderer for cells in a JTable. @version 1.15 0216 12/0203/0001 @author Alan Chung

Class TableColumn

A TableColumn represents all the attributes of a column in a JTable such as width resizibility minimum and maximum width. In addition the TableColumn provides slots for a renderer and an editor that can be used to display and edit the values in this column.

It is also possible to specify renderers and editors on a per type basis rather than a per column basis - see the setDefaultRenderer method in the JTable class. This default mechanism is only used when the renderer (or editor) in the TableColumn is null.

The TableColumn stores the link between the columns in the JTable and the columns in the TableModel. The modelIndex is the column in the TableModel which will be queried for the data values for the cells in this column. As the column moves around in the view this modelIndex does not change.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future releaseAs of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.49 0254 12/0203/0001 @author Alan Chung @author Philip Milne @see javax.swing.table.TableColumnModel @see javax.swing.table.DefaultTableColumnModel @see javax.swing.table.JTableHeader#getDefaultRenderer() @see JTable#getDefaultRenderer(Class) @see JTable#getDefaultEditor(Class) @see JTable#getCellRenderer(int int) @see JTable#getCellEditor(int int)

Class TableColumn, void sizeWidthToFit()

Resizes the TableColumn to fit the width of its header cell. This method does nothing if the header renderer is null (the default case). Otherwise it sets the minimum maximum and preferred widths of this column to the widths of the minimum maximum and preferred sizes of the Component delivered by the header renderer. The transient "width" property of this TableColumn is also set to the preferred width. Note this method is not used internally by the table package. @see #setPreferredWidth
Class TableColumn, Object identifier

This object is not used internally by the drawing machinery of the JTable; identifiers may be set in the TableColumn as as an optional way to tag and locate table columns. The table package does not modify or invoke any methods in these identiferidentifier objects other than the equals method which is used in the getColumnIndex() method in the DefaultTableColumnModel.

Class TableColumnModel

Defines the requirements for a table column model object suitable for use with JTable. @version 1.20 0222 12/0203/0001 @author Alan Chung @author Philip Milne @see DefaultTableColumnModel
Class TableColumnModel, int getColumnIndexAtX(int)

Returns the index of the column that lies on the horizontal point xPosition; or -1 if it lies outside the any of the column's bounds. In keeping with Swing's separable model architecture a TableColumnModel does not know how the table columns actually appear on screen. The visual presentation of the columns is the responsibility of the view/controller object using this model (typically JTable). The view/controller need not display the columns sequentially from left to right. For example columns could be displayed from right to left to accomodate a locale preference or some columns might be hidden at the request of the user. Because the model does not know how the columns are laid out on screen the given xPosition should not be considered to be a coordinate in 2D graphics space. Instead it should be considered to be a width from the start of the first column in the model. If the column index for a given X coordinate in 2D space is required JTable.columnAtPoint can be used instead. @return the index of the column; or -1 if no column is found @see javax.swing.JTable#columnAtPoint

Class TableModel

The TableModel interface specifies the methods the JTable will use to interrogate a tabular data model.

The JTable can be set up to display any data model which implements the TableModel interface with a couple of lines of code:

 TableModel myData = new MyTableModel(); JTable table = new JTable(myData); 

For further documentation see Creating a Table Model in The Java Tutorial.

@version 1.22 0223 12/0203/0001 @author Philip Milne @see JTable