I recently updated the SwingX library in an application from version 1.0 to 1.6.2 since we updated to JDK1.6 . I know the sorting has been changed to re-use some of the Core JDK components which were introduced in JDK 1.6 .
However, in version 1.0 it was possible to sort a column by clicking on the header, subsequent clicks reverted the sort order, and shift click removed the sorting and reverted back to the original order. After the update to version 1.6.2, the shift click behavior is no longer present.
A small sample
import org.jdesktop.swingx.JXTable;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.table.DefaultTableModel;
import java.awt.EventQueue;
public class JXTableSortingTest {
public static void main( String[] args ) {
EventQueue.invokeLater( new Runnable() {
public void run() {
initUI();
}
} );
}
private static void initUI(){
JFrame testFrame = new JFrame( "TestFrame" );
JXTable table = new JXTable( );
DefaultTableModel model =
new DefaultTableModel( new Object[][]{ new Object[]{"A"}, new Object[]{"B"}, new Object[]{"C"}, new Object[]{"D"}, new Object[]{"E"} }, new Object[]{"Click me"} );
table.setModel( model );
testFrame.getContentPane().add( new JScrollPane( table ) );
testFrame.pack();
testFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
testFrame.setVisible( true );
}
}
Running this sample with version 1.0 allows to remove the column sorting with a shift-click on the header, and with the 1.6.2 version this no longer works.
I checked the docs but did not encounter anything to switch this behavior back on. So before I start adding this functionality I though I asked it here if anybody knows an easy way to re-introduce the shift-click behavior