|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
javax.swing.table.DefaultTableCellRenderer
com.wordpress.tipsforjava.swing.table.DefaultTableHeaderCellRenderer
public class DefaultTableHeaderCellRenderer extends DefaultTableCellRenderer
A default cell renderer for a JTableHeader.
Extends DefaultTableCellRenderer.
DefaultTableHeaderCellRenderer attempts to provide identical behavior to the renderer which the Swing subsystem uses by default, the Sun proprietary class sun.swing.table.DefaultTableCellHeaderRenderer.
To apply any desired customization, DefaultTableHeaderCellRenderer may be suitably extended.
| Field Summary |
|---|
| Fields inherited from class DefaultTableCellRenderer | |
|---|---|
| CENTER, TOP, LEFT, BOTTOM, RIGHT, NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST, HORIZONTAL, VERTICAL, LEADING, TRAILING, NEXT, PREVIOUS, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT |
| Fields inherited from class JLabel | |
|---|---|
| CENTER, TOP, LEFT, BOTTOM, RIGHT, NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST, HORIZONTAL, VERTICAL, LEADING, TRAILING, NEXT, PREVIOUS, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT |
| Constructor Summary | |
DefaultTableHeaderCellRenderer()
Constructs a |
|
| Method Summary | |
|---|---|
protected Icon
|
getIcon(JTable table, int column)
Overloaded to return an icon suitable to a sorted column, or null if the column is unsorted. |
protected SortKey
|
getSortKey(JTable table, int column)
|
Component
|
getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
Returns the default table header cell renderer. |
| Constructor Detail |
|---|
public DefaultTableHeaderCellRenderer()
DefaultTableHeaderCellRenderer.
The horizontal alignment and text position are set as appropriate to a table header cell, and the renderer is set to be non-opaque.
| Method Detail |
|---|
protected Icon getIcon(JTable table, int column)
table - the JTable.column - the colummn index.
protected SortKey getSortKey(JTable table, int column)
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
The icon is set as appropriate for the header cell of a sorted or unsorted column, and the border appropriate to a table header cell is applied.
Subclasses may overide this method to provide custom content or formatting.
table - the JTable.value - the value to assign to the header cellisSelected - This parameter is ignored.hasFocus - This parameter is ignored.row - This parameter is ignored.column - the column of the header cell to render
Groovy Documentation