|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.freehep.swing.table.TableSorter
public class TableSorter
Utility to add a sorter for columns to a JTable which has a SortableTableModel.
Example of use:
TableModel model = ... DefaultSortableTableModel sm = new DefaultSortableTableModel(model); JTable table = new JTable(sm); TableSorter sorter = new TableSorter(table);
SortableTableModel
Constructor Summary | |
---|---|
TableSorter(JTable table)
Create a TableSorter. |
|
TableSorter(JTable table,
int column)
Create a TableSorter. |
|
TableSorter(JTable table,
int column,
boolean ascending)
Create a TableSorter specifiying initial sorting parameters. |
Method Summary | |
---|---|
int |
getSortOnColumn()
Find the current sort column. |
boolean |
isSortAscending()
Get the current sort order. |
void |
setSortAscending(boolean ascending)
Set the current sort order. |
void |
setSortOnColumn(int column)
Set the sort column. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableSorter(JTable table)
table
- The table to be sortedpublic TableSorter(JTable table, int column)
table
- The table to be sorted.column
- The column on which to sort, or SortableTableModel.UNSORTED
public TableSorter(JTable table, int column, boolean ascending)
table
- The table to be sorted.column
- The column on which to sort, or SortableTableModel.UNSORTED
ascending
- true
for ascending order, false
for descending orderMethod Detail |
---|
public int getSortOnColumn()
SortableTableModel.UNSORTED
public void setSortOnColumn(int column)
column
- The column on which to sort, or SortableTableModel.UNSORTED
public boolean isSortAscending()
true
if ascending order, false
for descending order.public void setSortAscending(boolean ascending)
ascending
- true
for ascending order, false
for descending order
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |