javax.swing.table
public class JTableHeader extends JComponent implements TableColumnModelListener, Accessible
Nested Class Summary | |
---|---|
protected class | JTableHeader.AccessibleJTableHeader |
Field Summary | |
---|---|
protected TableColumnModel | columnModel
The columnModel property. |
protected TableColumn | draggedColumn
The draggedColumn property. |
protected int | draggedDistance
The draggedDistance property. |
protected boolean | reorderingAllowed
The reorderingAllowed property. |
protected boolean | resizingAllowed
The resizingAllowed property. |
protected TableColumn | resizingColumn
The resizingColumn property. |
protected JTable | table
The table property. |
protected boolean | updateTableInRealTime
The updateTableInRealTime property. |
Constructor Summary | |
---|---|
JTableHeader()
Creates a new default instance. | |
JTableHeader(TableColumnModel cm)
Creates a new header. |
Method Summary | |
---|---|
void | columnAdded(TableColumnModelEvent event)
Receives notification when a column is added to the column model.
|
int | columnAtPoint(Point point)
Returns the index of the column at the specified point.
|
void | columnMarginChanged(ChangeEvent event)
Receives notification when a column margin changes in the column model.
|
void | columnMoved(TableColumnModelEvent event)
Receives notification when a column is moved within the column model.
|
void | columnRemoved(TableColumnModelEvent event)
Receives notification when a column is removed from the column model.
|
void | columnSelectionChanged(ListSelectionEvent event)
Receives notification when the column selection has changed.
|
protected TableColumnModel | createDefaultColumnModel()
Creates a default table column model.
|
protected TableCellRenderer | createDefaultRenderer()
Creates a default renderer.
|
AccessibleContext | getAccessibleContext()
Get the value of the {@link #accessibleContext} property.
|
TableColumnModel | getColumnModel()
Get the value of the {@link #columnModel} property.
|
TableCellRenderer | getDefaultRenderer()
Returns the default table cell renderer.
|
TableColumn | getDraggedColumn()
Get the column that is currently being dragged. |
int | getDraggedDistance()
Get the value of the {@link #draggedDistance} property.
|
Rectangle | getHeaderRect(int column)
Get the rectangle, occupied by the header of the given column.
|
boolean | getReorderingAllowed()
Check if it is possible to reorder the table columns by dragging column
header with mouse. |
boolean | getResizingAllowed()
Check if it is possible to resize the table columns by dragging the column
boundary in the table header with mouse. |
TableColumn | getResizingColumn()
Get the column that is currently being resized. |
JTable | getTable()
Get the table, having this header.
|
TableHeaderUI | getUI() |
String | getUIClassID() |
boolean | getUpdateTableInRealTime()
Get the value of the {@link #updateTableInRealTime} property.
|
protected void | initializeLocalVars()
Initializes the fields and properties of this class with default values.
|
boolean | isOpaque()
Get the value of the {@link #opaque} property.
|
protected String | paramString() |
void | resizeAndRepaint()
Validates the layout of this table header and repaints it. |
void | setColumnModel(TableColumnModel c)
Set the value of the {@link #columnModel} property.
|
void | setDefaultRenderer(TableCellRenderer cellRenderer)
Sets the default table cell renderer.
|
void | setDraggedColumn(TableColumn draggingIt)
Set the column that is currently being dragged. |
void | setDraggedDistance(int d)
Set the value of the {@link #draggedDistance} property.
|
void | setOpaque(boolean o)
Set the value of the {@link #opaque} property.
|
void | setReorderingAllowed(boolean allowed)
Set the table ability to reorder columns by dragging column header
with mouse. |
void | setResizingAllowed(boolean allowed)
Set the table ability to resize columns by dragging the column
boundary in the table header with mouse. |
void | setResizingColumn(TableColumn resizingIt)
The the column that is currently being resized. |
void | setTable(JTable t)
Set the value of the {@link #table} property.
|
void | setUI(TableHeaderUI u) |
void | setUpdateTableInRealTime(boolean u)
Set the value of the {@link #updateTableInRealTime} property.
|
void | updateUI() |
cm
is null
, a new
table column model is created by calling
{@link #createDefaultColumnModel()}.
Parameters: cm the table column model (null
permitted).
Parameters: event the table column model event
Parameters: point the point.
Returns: The column index, or -1.
Parameters: event the table column model event
Parameters: event the table column model event
Parameters: event the table column model event
Parameters: event the table column model event
Returns: A default table column model.
Returns: A default renderer.
Returns: The current value of the property
Returns: The current value of the property
Returns: The default table cell renderer.
Returns: the column being dragged, null if none.
Returns: The current value of the property
Parameters: column the column, for that the header area is requested.
Returns: the column header area.
Returns: true if reordering is allowed, false otherwise.
Returns: true if resizing is allowed, false otherwise.
Returns: the column being currently resized, null if none.
Returns: the table, having this header.
Returns: The current value of the property
Returns: The current value of the property
revalidate()
followed by
repaint()
.Parameters: c The new value of the property
Parameters: cellRenderer the renderer.
Parameters: draggingIt the column being currently dragged, null if none.
Parameters: d The new value of the property
Parameters: o The new value of the property
Parameters: allowed true if reordering is allowed, false otherwise.
Parameters: allowed true if resizing is allowed, false otherwise.
Parameters: resizingIt the column being currently resized
Parameters: t The new value of the property
Parameters: u The new value of the property