A
TableColumn
represents all the attributes of a column in a
JTable
, such as width, resizability, 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.
Note: Some implementations may assume that all TableColumnModel
s are unique, therefore we would recommend that the same TableColumn
instance not be added more than once to a TableColumnModel
. To show TableColumn
s with the same column of data from the model, create a new instance with the same modelIndex
.
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. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans
package. Please see XMLEncoder
.