public class SortableTableModel extends DefaultTableModel implements Comparator
Modifier and Type | Field and Description |
---|---|
protected Vector |
ascendCol |
protected int |
currCol |
protected Integer |
minusOne |
protected Integer |
one |
columnIdentifiers, dataVector
listenerList
Constructor and Description |
---|
SortableTableModel() |
SortableTableModel(DefaultTableModel copyModel) |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(Object columnName)
addColumn methods are inherited from the DefaultTableModel class.
|
void |
addColumn(Object columnName,
Object[] columnData) |
void |
addColumn(Object columnName,
Vector columnData) |
void |
addMouseListenerToHeaderInTable(JTable table) |
int |
compare(Object v1,
Object v2)
This method is the implementation of the Comparator interface.
|
void |
sort()
This method sorts the rows using Java's Collections class.
|
void |
sortByColumn(int column) |
addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected int currCol
public SortableTableModel()
public SortableTableModel(DefaultTableModel copyModel)
public void addColumn(Object columnName)
addColumn
in class DefaultTableModel
public void addColumn(Object columnName, Object[] columnData)
addColumn
in class DefaultTableModel
public void addColumn(Object columnName, Vector columnData)
addColumn
in class DefaultTableModel
public int compare(Object v1, Object v2)
compare
in interface Comparator
public void sort()
public void sortByColumn(int column)
public void addMouseListenerToHeaderInTable(JTable table)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses