JTable
. 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 JavaBeansTM has been added to the java.beans
package. Please see java.beans.XMLEncoder.
Détail du champ |
private static final String uiClassID
protected JTable table
null
.protected TableColumnModel columnModel
TableColumnModel
of the table header.protected boolean reorderingAllowed
protected boolean resizingAllowed
protected boolean updateTableInRealTime
protected transient TableColumn resizingColumn
null
if not resizing.protected transient TableColumn draggedColumn
null
if not dragging.protected transient int draggedDistance
private TableCellRenderer defaultRenderer
TableColumn
does not define a headerRenderer
.Détail du constructeur |
public JTableHeader()
JTableHeader
with a default TableColumnModel
.public JTableHeader(TableColumnModel cm)
JTableHeader
which is initialized with cm
as the column model. If cm
is null
this method will initialize the table header with a default TableColumnModel
.cm
- the column model for the tableDétail de la méthode |
public void setTable(JTable table)
table
- the new tablepublic JTable getTable()
table
propertypublic void setReorderingAllowed(boolean reorderingAllowed)
reorderingAllowed
- true if the table view should allow reordering; otherwise falsepublic boolean getReorderingAllowed()
reorderingAllowed
propertypublic void setResizingAllowed(boolean resizingAllowed)
resizingAllowed
- true if table view should allow resizingpublic boolean getResizingAllowed()
resizingAllowed
propertypublic TableColumn getDraggedColumn()
null
.null
public int getDraggedDistance()
public TableColumn getResizingColumn()
null
.null
public void setUpdateTableInRealTime(boolean flag)
public boolean getUpdateTableInRealTime()
public void setDefaultRenderer(TableCellRenderer defaultRenderer)
headerRenderer
is defined by a TableColumn
.defaultRenderer
- the default rendererpublic TableCellRenderer getDefaultRenderer()
headerRenderer
is defined by a TableColumn
.public int columnAtPoint(Point point)
point
lies in, or -1 if it lies out of bounds.point
lies in, or -1 if it lies out of boundspublic Rectangle getHeaderRect(int column)
column
. When the column
parameter is out of bounds this method uses the same conventions as the JTable
method getCellRect
.column
public String getToolTipText(MouseEvent event)
event
- the location of the event identifies the proper renderer and, therefore, the proper tippublic TableHeaderUI getUI()
TableHeaderUI
object that renders this componentpublic void setUI(TableHeaderUI ui)
ui
- the TableHeaderUI
L&F objectpublic void updateUI()
UIManager
that the look and feel (L&F) has changed. Replaces the current UI object with the latest version from the UIManager
.public String getUIClassID()
public void setColumnModel(TableColumnModel columnModel)
newModel
and registers for listener notifications from the new column model.columnModel
- the new data source for this tableIllegalArgumentException
- if newModel
is null
public TableColumnModel getColumnModel()
TableColumnModel
that contains all column information of this table header.columnModel
propertypublic void columnAdded(TableColumnModelEvent e)
Application code will not use these methods explicitly, they are used internally by JTable
.
e
- the event receivedpublic void columnRemoved(TableColumnModelEvent e)
Application code will not use these methods explicitly, they are used internally by JTable
.
e
- the event receivedpublic void columnMoved(TableColumnModelEvent e)
Application code will not use these methods explicitly, they are used internally by JTable
.
e
- the event receivedpublic void columnMarginChanged(ChangeEvent e)
Application code will not use these methods explicitly, they are used internally by JTable
.
e
- the event receivedpublic void columnSelectionChanged(ListSelectionEvent e)
TableColumnModel
is changed. This method currently has no effect (the header is not redrawn). Application code will not use these methods explicitly, they are used internally by JTable
.
e
- the event receivedprotected TableColumnModel createDefaultColumnModel()
DefaultTableColumnModel
. A subclass can override this method to return a different column model objectprotected TableCellRenderer createDefaultRenderer()
TableColumn
.protected void initializeLocalVars()
public void resizeAndRepaint()
revalidate
followed by repaint
.public void setDraggedColumn(TableColumn aColumn)
draggedColumn
to aColumn
. Application code will not use this method explicitly, it is used internally by the column dragging mechanism.
aColumn
- the column being dragged, or null
if no column is being draggedpublic void setDraggedDistance(int distance)
draggedDistance
to distance
.distance
- the distance draggedpublic void setResizingColumn(TableColumn aColumn)
resizingColumn
to aColumn
. Application code will not use this method explicitly, it is used internally by the column sizing mechanism.
aColumn
- the column being resized, or null
if no column is being resizedprivate void writeObject(ObjectOutputStream s)
readObject
and writeObject
in JComponent
for more information about serialization in Swing.protected String paramString()
JTableHeader
. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null
. Overriding paramString
to provide information about the specific new aspects of the JFC components.
JTableHeader
public AccessibleContext getAccessibleContext()