The table Package

public abstract interface ISortableTableModel extends javax.swing.table.TableModel

Interface for table model that allows sorting.

								sortByColumn

public void sortByColumn(int column, boolean isAscent)

Sorts the table by the given column, in ascending or descending order.

Parameters:

column: the index of the column on which to sort

isAscent: if true, sort in ascending order

								getIndexes

public int[] getIndexes()

Gets the index values by which the table is sorted.

Returns:

the array of index values that translates between logical and physical row order

public class SortableTableModel extends javax.swing.table.DefaultTableModel implements ISortableTableModel

Table model for a table with sortable columns. It implements TableModel methods ...

Get LDAP Programming with Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.