Modifier and Type | Class and Description |
---|---|
static interface |
TableUtils.SortDelegate
An interface that will be notified when sorting of a
JTable should occur. |
static class |
TableUtils.SortDirection
An enumeration representing the sort order of a table column.
|
Modifier and Type | Method and Description |
---|---|
static void |
makeSortable(JTable table,
TableUtils.SortDelegate sortDelegate)
Installs a listener on the given
JTable 's JTableHeader ,
which will notify the given TableUtils.SortDelegate when the user clicks the header
and thus wishes to sort. |
static void |
makeStriped(JTable table,
Color stipeColor)
Add's striping to the background of the given
JTable . |
public static void makeStriped(JTable table, Color stipeColor)
JTable
. The actual striping is
installed on the containing JScrollPane
's JViewport
, so if this table is not
added to a JScrollPane
, then no stripes will be painted. This method can be called
before the given table is added to a scroll pane, though, as a PropertyChangeListener
will be installed to handle "ancestor" changes.table
- the table to paint row stripes for.stipeColor
- the color of the stripes to paint.public static void makeSortable(JTable table, TableUtils.SortDelegate sortDelegate)
JTable
's JTableHeader
,
which will notify the given TableUtils.SortDelegate
when the user clicks the header
and thus wishes to sort. The listener will also call
TableHeaderUtils.toggleSortDirection(javax.swing.table.JTableHeader, int)
and TableHeaderUtils.setPressedColumn(javax.swing.table.JTableHeader, int)
which will install hints for header renders to render the column headers in the
appropriate state.table
- the table so install the SortDelegate
on.sortDelegate
- the delegate to notify when sorting should be performed.