SwingX 1.6.x

Sorting

With SwingX 1.6 on Java 1.6 there's only one supported way to do sorting with Glazed Lists and JXTable using TableComparatorChooser:

Approach: TableComparatorChooser

JXTable table = ...

table.setSortable(false);

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

table.setAutoCreateRowSorter(false);

table.setRowSorter(null);

Benefits

Drawbacks

Introducing JXTableSupport

To hide the ugly details of setting up JXTable to work with GlazedLists the nightly build of GlazedLists offers the new helper class JXTableSupport, so you don't need to code the above but the following:

JXTable table = ... 

JXTableSupport<Issue> tableSupport = JXTableSupport.<Issue>install(

    table,                                  // the JXTable

    myIssues,                               // the EventList for TableModel and SelectionModel

    new IssueTableFormat(),                 // the TableFormat

    sortedIssues,                           // the SortedList for TableComparatorChooser

    TableComparatorChooser.SINGLE_COLUMN    // the SortingStrategy for TableComparatorChooser );

...

// dispose after use

tableSupport.dispose();

This will create an EventTableModel, EventSelectionModel and TableComparatorChooser for you and configure the JXTable instance for use with GlazedLists.

For details, please see the Javadoc and/or source code.