javax.swing.table
Class TableColumn
- Serializable
Represents the attributes of a column in a table, including the column index,
width, minimum width, preferred width and maximum width.
TableColumn() - Creates a new
TableColumn that maps to column 0 in the
related table model.
|
TableColumn(int modelIndex) - Creates a new
TableColumn that maps to the specified column
in the related table model.
|
TableColumn(int modelIndex, int width) - Creates a new
TableColumn that maps to the specified column
in the related table model, and has the specified width .
|
TableColumn(int modelIndex, int width, TableCellRenderer cellRenderer, TableCellEditor cellEditor) - Creates a new
TableColumn that maps to the specified column
in the related table model, and has the specified width ,
cellRenderer and cellEditor .
|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
COLUMN_WIDTH_PROPERTY
public static final String COLUMN_WIDTH_PROPERTY
The name for the columnWidth
property. Note that the typo
in the name value is deliberate, to match the specification.
maxWidth
protected int maxWidth
The maximum width.
minWidth
protected int minWidth
The minimum width.
modelIndex
protected int modelIndex
The index of the corresponding column in the table model.
width
protected int width
The width.
TableColumn
public TableColumn()
Creates a new TableColumn
that maps to column 0 in the
related table model. The default width is 75
units.
TableColumn
public TableColumn(int modelIndex)
Creates a new TableColumn
that maps to the specified column
in the related table model. The default width is 75
units.
modelIndex
- the index of the column in the model
TableColumn
public TableColumn(int modelIndex,
int width)
Creates a new TableColumn
that maps to the specified column
in the related table model, and has the specified width
.
modelIndex
- the index of the column in the modelwidth
- the width
TableColumn
public TableColumn(int modelIndex,
int width,
TableCellRenderer cellRenderer,
TableCellEditor cellEditor)
Creates a new TableColumn
that maps to the specified column
in the related table model, and has the specified width
,
cellRenderer
and cellEditor
.
modelIndex
- the index of the column in the modelwidth
- the widthcellRenderer
- the cell renderer (null
permitted).cellEditor
- the cell editor (null
permitted).
enableResizedPosting
public void enableResizedPosting()
1.3
This method is empty, unused and deprecated.
getMaxWidth
public int getMaxWidth()
Returns the maximum width.
getMinWidth
public int getMinWidth()
Returns the TableColumn
's minimum width.
getModelIndex
public int getModelIndex()
Returns the index of the column in the related
TableModel
that
this
TableColumn
maps to.
getResizable
public boolean getResizable()
getResizable
true
if this column is resizable,
false
otherwise
setIdentifier
public void setIdentifier(Object identifier)
Sets the identifier for the column.
identifier
- the identifier
setMaxWidth
public void setMaxWidth(int maxWidth)
Sets the maximum width and, if necessary, updates the width
and preferredWidth
.
maxWidth
- the maximum width
setMinWidth
public void setMinWidth(int minWidth)
Sets the minimum width for the column and, if necessary, updates the
width
and preferredWidth
.
minWidth
- the minimum width
setModelIndex
public void setModelIndex(int modelIndex)
Sets the index of the column in the related
TableModel
that this
TableColumn
maps to.
modelIndex
- the column index in the model.
setPreferredWidth
public void setPreferredWidth(int preferredWidth)
setPreferredWidth
preferredWidth
- the preferred width
setResizable
public void setResizable(boolean isResizable)
setResizable
isResizable
- true
if this column is resizable,
false
otherwise
setWidth
public void setWidth(int newWidth)
setWidth
TableColumn.java --
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.