SwingX 1.0.X

Sorting

There's 2 different ways to do sorting with Glazed Lists and JXTable, each with their own advantages and disadvantages.

Approach 1: EventListJXTableSorting

SortedList sortedList = ...

JXTable table = ...

EventListJXTableSorting sorting = EventListJXTableSorting.install(table, sortedList);

sorting.setMultipleColumnSort(true);

Benefits

Drawbacks

Approach 2: TableComparatorChooser

JXTable table = ...

table.setSortable(false);

table.getTableHeader().setDefaultRenderer(new JTableHeader().getDefaultRenderer());

Benefits

Drawbacks

Maintaining Selection

It is necessary to disable the SelectionMapper to use JXTable with Glazed Lists. Otherwise, the SelectionMapper competes with Glazed Lists' own selection management, and selection is left in an inconsistent state. To disable SelectionMapper:

JXTable table = ... 

table.getSelectionMapper().setEnabled(false);