API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.table. TableColumn View Source
Author(s)
Alan Chung
Philip Milne
Since
Version
1.63 11/17/05
Serial
Hierarchy
 Object
      TableColumn
Implements
 Serializable
Subclasses
Description
public class TableColumn
  A TableColumn represents all the attributes of a column in a JTable, such as width, resizibility, minimum and maximum width.
Constructors
public TableColumn ()
  Cover method, using a default model index of 0, default width of 75, a null renderer and a null editor.
public TableColumn (int modelIndex)
  Cover method, using a default width of 75, a null renderer and a null editor.
public TableColumn (int modelIndex, int width)
  Cover method, using a null renderer and a null editor.
public TableColumn (int modelIndex, int width, TableCellRenderer cellRenderer, TableCellEditor cellEditor)
  Creates and initializes an instance of TableColumn with the specified model index, width, cell renderer, and cell editor; all TableColumn constructors delegate to this one.
Methods
Hide/Show inherited methods
publicsynchronized void addPropertyChangeListener (PropertyChangeListener listener)
  Adds a PropertyChangeListener to the listener list.
protected TableCellRenderer createDefaultHeaderRenderer ()
  As of Java 2 platform v1.3, this method is not called by the TableColumn constructor.
@Deprecated
public void disableResizedPosting ()
This field was not used in previous releases and there are currently no plans to support it in the future.
@Deprecated
public void enableResizedPosting ()
This field was not used in previous releases and there are currently no plans to support it in the future.
public TableCellEditor getCellEditor ()
  Returns the TableCellEditor used by the JTable to edit values for this column.
public TableCellRenderer getCellRenderer ()
  Returns the TableCellRenderer used by the JTable to draw values for this column.
public TableCellRenderer getHeaderRenderer ()
  Returns the TableCellRenderer used to draw the header of the TableColumn.
public Object getHeaderValue ()
  Returns the Object used as the value for the header renderer.
public Object getIdentifier ()
  Returns the identifier object for this column.
public int getMaxWidth ()
  Returns the maximum width for the TableColumn.
public int getMinWidth ()
  Returns the minimum width for the TableColumn.
public int getModelIndex ()
  Returns the model index for this column.
public int getPreferredWidth ()
  Returns the preferred width of the TableColumn.
publicsynchronized PropertyChangeListener getPropertyChangeListeners ()
  Returns an array of all the PropertyChangeListeners added to this TableColumn with addPropertyChangeListener().
public boolean getResizable ()
  Returns true if the user is allowed to resize the TableColumn's width, false otherwise.
public int getWidth ()
  Returns the width of the TableColumn.
publicsynchronized void removePropertyChangeListener (PropertyChangeListener listener)
  Removes a PropertyChangeListener from the listener list.
public void setCellEditor (TableCellEditor cellEditor)
  Sets the editor to used by when a cell in this column is edited.
public void setCellRenderer (TableCellRenderer cellRenderer)
  Sets the TableCellRenderer used by JTable to draw individual values for this column.
public void setHeaderRenderer (TableCellRenderer headerRenderer)
  Sets the TableCellRenderer used to draw the TableColumn's header to headerRenderer.
public void setHeaderValue (Object headerValue)
  Sets the Object whose string representation will be used as the value for the headerRenderer.
public void setIdentifier (Object identifier)
  Sets the TableColumn's identifier to anIdentifier.
public void setMaxWidth (int maxWidth)
  Sets the TableColumn's maximum width to maxWidth or, if maxWidth is less than the minimum width, to the minimum width.
public void setMinWidth (int minWidth)
  Sets the TableColumn's minimum width to minWidth, adjusting the new minimum width if necessary to ensure that 0 <= minWidth <= maxWidth.
public void setModelIndex (int modelIndex)
  Sets the model index for this column.
public void setPreferredWidth (int preferredWidth)
  Sets this column's preferred width to preferredWidth.
public void setResizable (boolean isResizable)
  Sets whether this column can be resized.
public void setWidth (int width)
  This method should not be used to set the widths of columns in the JTable, use setPreferredWidth instead.
public void sizeWidthToFit ()
  Resizes the TableColumn to fit the width of its header cell.
Fields
Hide/Show inherited fields
publicfinalstatic String CELL_RENDERER_PROPERTY = "cellRenderer"
  Obsolete as of Java 2 platform v1.3.
protected TableCellEditor cellEditor
The editor used to edit the data cells of the column.
protected TableCellRenderer cellRenderer
The renderer used to draw the data cells of the column.
publicfinalstatic String COLUMN_WIDTH_PROPERTY = "columWidth"
  Obsolete as of Java 2 platform v1.3.
publicfinalstatic String HEADER_RENDERER_PROPERTY = "headerRenderer"
  Obsolete as of Java 2 platform v1.3.
publicfinalstatic String HEADER_VALUE_PROPERTY = "headerValue"
  Obsolete as of Java 2 platform v1.3.
protected TableCellRenderer headerRenderer
The renderer used to draw the header of the column.
protected Object headerValue
The header value of the column.
protected 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.
protected boolean isResizable
If true, the user is allowed to resize the column; the default is true.
protected int maxWidth
The maximum width of the column.
protected int minWidth
The minimum width of the column.
protected int modelIndex
  The index of the column in the model which is to be displayed by this TableColumn.
@Deprecated
protectedtransient int resizedPostingDisableCount
This field was not used in previous releases and there are currently no plans to support it in the future.
protected int width
The width of the column.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar