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.