All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.table.JTableHeader
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.table.JTableHeader
- public class JTableHeader
- extends JComponent
- implements TableColumnModelListener
-
columnModel
- The TableColumnModel of the table header
-
draggedColumn
- The index of the column being dragged.
-
draggedDistance
- The distance from its original position the column has been dragged
-
reorderingAllowed
- Reordering of columns are allowed by the user
-
resizingAllowed
- Resizing of columns are allowed by the user
-
resizingColumn
- The index of the column being resized.
-
table
-
-
updateTableInRealTime
- If this flag is true, then the header will repaint the table as
a column is dragged or resized.
-
JTableHeader(TableColumnModel)
-
-
columnAdded(TableColumnModelEvent)
-
-
columnMarginChanged(ChangeEvent)
-
-
columnMoved(TableColumnModelEvent)
-
-
columnRemoved(TableColumnModelEvent)
-
-
columnSelectionChanged(ListSelectionEvent)
-
-
getColumnModel()
-
-
getDraggedColumn()
- Returns the index of the dragged column, if and only if a drag is in
process.
-
getDraggedDistance()
- Returns the column's horizontal distance from its original
position, if and only if a drag is in process.
-
getReorderingAllowed()
- Returns true if the receiver allows the user to rearrange columns by
dragging their headers, false otherwise.
-
getResizingAllowed()
- Returns true if the receiver allows the user to resize columns by dragging
between their headers, false otherwise.
-
getResizingColumn()
- Returns the index of the resizing column.
-
getTable()
-
-
getUI()
-
-
getUpdateTableInRealTime()
- Returns true if the receiver updates the body of the table view in real
time when a column is resized or dragged.
-
resizeAndRepaint()
- Properly sizes the receiver and its header view, and marks it as
needing display.
-
setColumnModel(TableColumnModel)
- Sets the column model for this table to newModel and registers
with for listner notifications from the new column model.
-
setDraggedColumn(int)
- Sets the header's draggedColumn to columnIndex
-
setDraggedDistance(int)
- Sets the header's draggedDistance to distance
-
setReorderingAllowed(boolean)
- Sets whether the user can drag column headers to reorder columns.
-
setResizingAllowed(boolean)
- Sets whether the user can resize columns by dragging between headers.
-
setResizingColumn(int)
- Sets the header's resizingColumn to columnIndex
-
setUI(TableHeaderUI)
-
-
setUpdateTableInRealTime(boolean)
- Sets whether the body of the table updates in real time when
a column is resized or dragged.
-
updateUI()
- Notification from the UIFactory that the L&F
has changed.
table
protected JTable table
columnModel
protected TableColumnModel columnModel
- The TableColumnModel of the table header
reorderingAllowed
protected boolean reorderingAllowed
- Reordering of columns are allowed by the user
resizingAllowed
protected boolean resizingAllowed
- Resizing of columns are allowed by the user
resizingColumn
protected int resizingColumn
- The index of the column being resized. 0 if not resizing
draggedColumn
protected int draggedColumn
- The index of the column being dragged. 0 if not dragging
draggedDistance
protected int draggedDistance
- The distance from its original position the column has been dragged
updateTableInRealTime
protected boolean updateTableInRealTime
- If this flag is true, then the header will repaint the table as
a column is dragged or resized.
JTableHeader
public JTableHeader(TableColumnModel cm)
getTable
public JTable getTable()
setReorderingAllowed
public void setReorderingAllowed(boolean b)
- Sets whether the user can drag column headers to reorder columns.
- Parameters:
- flag - true if the table view should allow
reordering
- See Also:
- getReorderingAllowed
getReorderingAllowed
public boolean getReorderingAllowed()
- Returns true if the receiver allows the user to rearrange columns by
dragging their headers, false otherwise. The default is true. You can
rearrange columns programmatically regardless of this setting.
- Returns:
- true if the receiver allows the user to rearrange columns by
dragging their headers, false otherwise
- See Also:
- setReorderingAllowed
setResizingAllowed
public void setResizingAllowed(boolean b)
- Sets whether the user can resize columns by dragging between headers.
- Parameters:
- flag - true if table view should allow
resizing
- See Also:
- getResizingAllowed
getResizingAllowed
public boolean getResizingAllowed()
- Returns true if the receiver allows the user to resize columns by dragging
between their headers, false otherwise. The default is true. You can
resize columns programmatically regardless of this setting.
- Returns:
- true if the receiver allows the user to resize columns by
dragging between their headers, false otherwise.
- See Also:
- setResizingAllowed
getDraggedColumn
public int getDraggedColumn()
- Returns the index of the dragged column, if and only if a drag is in
process.
- Returns:
- the index of the dragged column, if and only if a drag is in
process, otherwise returns -1
- See Also:
- getDraggedDistance
getDraggedDistance
public int getDraggedDistance()
- Returns the column's horizontal distance from its original
position, if and only if a drag is in process. Otherwise, the
the return value is meaningless.
- Returns:
- the column's horizontal distance from its original
position, if and only if a drag is in process
- See Also:
- getDraggedColumn
getResizingColumn
public int getResizingColumn()
- Returns the index of the resizing column. If no column is being
resized this method returns -1.
- Returns:
- the index of the resizing column
setUpdateTableInRealTime
public void setUpdateTableInRealTime(boolean flag)
- Sets whether the body of the table updates in real time when
a column is resized or dragged.
- Parameters:
- flag - true if tableView should update
the body of the table in real time
- See Also:
- getUpdateTableInRealTime
getUpdateTableInRealTime
public boolean getUpdateTableInRealTime()
- Returns true if the receiver updates the body of the table view in real
time when a column is resized or dragged. User can set this flag to
false to speed up the table's response to user resize or drag actions.
The default is true.
- Returns:
- true if the table updates in real time
- See Also:
- setUpdateTableInRealTime
getUI
public TableHeaderUI getUI()
setUI
public void setUI(TableHeaderUI ui)
updateUI
public void updateUI()
- Notification from the UIFactory that the L&F
has changed.
- Overrides:
- updateUI in class JComponent
setColumnModel
public void setColumnModel(TableColumnModel newModel)
- Sets the column model for this table to newModel and registers
with for listner notifications from the new column model.
- Parameters:
- newModel - the new data source for this table
- Throws: IllegalArgumentException
- if newModel is null
- See Also:
- getColumnModel
getColumnModel
public TableColumnModel getColumnModel()
columnAdded
public void columnAdded(TableColumnModelEvent e)
columnRemoved
public void columnRemoved(TableColumnModelEvent e)
columnMoved
public void columnMoved(TableColumnModelEvent e)
columnMarginChanged
public void columnMarginChanged(ChangeEvent e)
columnSelectionChanged
public void columnSelectionChanged(ListSelectionEvent e)
resizeAndRepaint
public void resizeAndRepaint()
- Properly sizes the receiver and its header view, and marks it as
needing display. Also resets cursor rectangles for the header view
and line scroll amounts for the JScrollPane.
setDraggedColumn
public void setDraggedColumn(int columnIndex)
- Sets the header's draggedColumn to columnIndex
setDraggedDistance
public void setDraggedDistance(int distance)
- Sets the header's draggedDistance to distance
setResizingColumn
public void setResizingColumn(int columnIndex)
- Sets the header's resizingColumn to columnIndex
All Packages Class Hierarchy This Package Previous Next Index