public interface TableColumnModel
JTable。
DefaultTableColumnModel
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(TableColumn aColumn)
追加
aColumn的
tableColumns数组的末尾。
|
void |
addColumnModelListener(TableColumnModelListener x)
添加一个用于表列模型事件的侦听器。
|
TableColumn |
getColumn(int columnIndex)
返回在
columnIndex柱
TableColumn对象。
|
int |
getColumnCount()
返回模型中的列数。
|
int |
getColumnIndex(Object columnIdentifier)
返回表中的第一列的标识符等于
identifier指数,相比使用
equals。
|
int |
getColumnIndexAtX(int xPosition)
返回列位于水平点,
xPosition指数;或1如果它之外的任何列的界限。
|
int |
getColumnMargin()
返回每个列的单元格之间的宽度。
|
Enumeration<TableColumn> |
getColumns()
回归模型中所有的列的
Enumeration。
|
boolean |
getColumnSelectionAllowed()
如果可以选择列,则返回真正的。
|
int |
getSelectedColumnCount()
返回选定列的数目。
|
int[] |
getSelectedColumns()
返回所有选定的列索引数组。
|
ListSelectionModel |
getSelectionModel()
返回当前选择模型。
|
int |
getTotalColumnWidth()
返回所有列的总宽度。
|
void |
moveColumn(int columnIndex, int newIndex)
将列在
columnIndex其头
newIndex。
|
void |
removeColumn(TableColumn column)
删除
TableColumn
column从
tableColumns阵列。
|
void |
removeColumnModelListener(TableColumnModelListener x)
移除表列模型事件的侦听器。
|
void |
setColumnMargin(int newMargin)
集
newMargin的
TableColumn柱边缘。
|
void |
setColumnSelectionAllowed(boolean flag)
设置此模型中的列是否可以选择。
|
void |
setSelectionModel(ListSelectionModel newModel)
设置选择模型。
|
void addColumn(TableColumn aColumn)
aColumn的
tableColumns数组的末尾。这种方法的帖子
columnAdded事件的听众。
aColumn -
TableColumn加以补充
removeColumn(javax.swing.table.TableColumn)
void removeColumn(TableColumn column)
TableColumn
column从
tableColumns阵列。这个方法如果
column不在表中的列的列表,什么也不做。这种方法的帖子
columnRemoved事件的听众。
column -
TableColumn被删除
addColumn(javax.swing.table.TableColumn)
void moveColumn(int columnIndex,
int newIndex)
columnIndex到
newIndex头。在
columnIndex老柱将被发现在
newIndex,曾在
newIndex列左或右移使房间。这将没有任何列,如果
columnIndex等于
newIndex。这种方法的帖子
columnMoved事件的听众。
columnIndex -柱感动指数
newIndex -柱的新位置指数
IllegalArgumentException -如果
columnIndex或
newIndex不在有效范围
void setColumnMargin(int newMargin)
newMargin的
TableColumn柱边缘。这种方法的帖子
columnMarginChanged事件的听众。
newMargin的宽度,以像素为单位,新列的边缘
getColumnMargin()
int getColumnCount()
Enumeration<TableColumn> getColumns()
Enumeration。
Enumeration
int getColumnIndex(Object columnIdentifier)
identifier指数,相比使用
equals。
columnIdentifier的标识对象
identifier指数
IllegalArgumentException -如果
identifier是
null,或没有
TableColumn这
identifier
getColumn(int)
TableColumn getColumn(int columnIndex)
columnIndex柱
TableColumn对象。
columnIndex -所需的列的索引
columnIndex柱
TableColumn对象
int getColumnMargin()
int getColumnIndexAtX(int xPosition)
xPosition指数;或1如果它之外的任何列的界限。在保持与摆动的分离模型体系,一个tablecolumnmodel不知道怎么表列实际上出现在屏幕上。列的视觉呈现的是责任的视图/控制器对象使用这个模型(通常JTable)。视图/控制器不需要从左到右依次显示列。例如,可以显示从右到左的列,以适应区域设置偏好或一些列可能被隐藏在用户的请求。由于模型不知道怎么列放在屏幕上,给
xPosition不应该被认为是二维图形的空间坐标。相反,它应该被认为是一个宽度从第一列在模型中的开始。如果索引列为一个给定的二维空间中的x坐标是必需的,
JTable.columnAtPoint可以代替。
JTable.columnAtPoint(java.awt.Point)
int getTotalColumnWidth()
void setColumnSelectionAllowed(boolean flag)
flag -如果列可以选择;否则为false
getColumnSelectionAllowed()
boolean getColumnSelectionAllowed()
setColumnSelectionAllowed(boolean)
int[] getSelectedColumns()
int getSelectedColumnCount()
void setSelectionModel(ListSelectionModel newModel)
newModel -
ListSelectionModel对象
getSelectionModel()
ListSelectionModel getSelectionModel()
ListSelectionModel对象
setSelectionModel(javax.swing.ListSelectionModel)
void addColumnModelListener(TableColumnModelListener x)
x -
TableColumnModelListener对象
void removeColumnModelListener(TableColumnModelListener x)
x -
TableColumnModelListener对象
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.