The simplest method to call, assuming you don't mind working with a standard JTable, is TableUtils.createStandardSortableTable(tableModel) . Just define a table model adapter for your data, and pass it in as a parameter to this method. You'll get back a fully multi-column sortable table with default renderers installed for common column types. See the BaseTableModel/BeanTableModel classes for convenient table model superclasses.
Code:
public static JTable createStandardSortableTable(TableModel tableModel) {
JTable table = new JTable();
ShuttleSortableTableModel sortedModel = new ShuttleSortableTableModel(
tableModel);
table.setAutoCreateColumnsFromModel(true);
table.setModel(sortedModel);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
installDefaultRenderers(table);
TableSortIndicator sortIndicator = new TableSortIndicator(table);
new SortTableCommand(table, sortIndicator.getColumnSortList());
sizeColumnsToFitRowData(table);
return table;
}