Checkbox column in table: how to mark sortable?


How can I make a checkbox column sortable, means, clicking its header will sort all enable rows first vice-versa?


You can extend the CheckBox and implement the Comparable interface. You could also use a custom ItemSorter or a DefaultItemSorter with a custom Comparator.

If you’re a Pro Account subscriber, please see article
#180: How to sort components that do not implement Comparable?

And for completeness: if the underlying column contains Boolean instances and the checkboxes are created e.g. by a TableColumnGenerator, the column should be sortable by default as Boolean implements Comparable in JRE 1.5 and later (IIRC).