« Return to Thread: EventListJXTableSorting
Steve,
1. Your test class fails to work reliably because you're not building /
showing your Swing components on the EDT. Wrap everything in your main
method in a Runnable and post it to the EDT like so:
SwingUtilities.invokeLater(new Runnable() {
public void run() {
GlazedListJXTableProblem frame = null;
if( args.length > 0 ) {
frame = new GlazedListJXTableProblem( args[ 0 ] );
} else {
System.out.println( "specify List as first parameter: { JTable |
JXTableJXSorting | JXTableGLSorting }");
System.exit( 0 );
}
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.setVisible( true );
}
});
2. I read the class doc for EventListJXTableSorting and it explains how to
use it:
a) Create a {@link SortedList} and {@link EventTableModel} that depends on
that {@link SortedList}.
b) Create a {@link JXTable} using the {@link EventTableModel} as its model.
c) Run the {@link EventListJXTableSorting#install} method to bind the {@link
JXTable}'s headers to the {@link SortedList}'s {@link Comparator}.
Notice that it says nothing about TableComparatorChooser. In fact, later in
the class doc it even mentions this:
"The behaviour of multiple column sorting in JXTable is not particularly
flexible. For different configuration options, consider using a {@link
TableComparatorChooser} instead of {@link EventListJXTableSorting}."
3. Removing the call to TableComparatorChooser.install seems to produce the
behaviour you are looking for.
4. I was using the latest jar of GL and the latest jar of swingx and I never
saw two sort icons like the snapshots you pointed at. That said, I'd guess
they are caused by having two different table sorting mechanisms in play
(TableComparatorChooser and EventListJXTableSorting).
Hope this helps,
James
« Return to Thread: EventListJXTableSorting
| Free embeddable forum powered by Nabble | Forum Help |