0

I have a JTable where headers are sortable, Below is the code that I have used:

TableRowSorter<FolderModel> sorter = new TableRowSorter<FolderModel>(folderModel);
setRowSorter(sorter);

One column header has a checkbox, rendered with a custom renderer, to check and uncheck all the column values.

I have to choose a different gesture to distinguish between check/uncheck and sorting. I think a single click to sort and a double click to check/uncheck, but the problem is that also a double click fires sorting. What solution is possible?

Sachin
  • 901
  • 2
  • 10
  • 23
  • 1
    Possible duplicate of [*How can I put a control in the JTableHeader of a JTable?*](http://stackoverflow.com/q/7137786/230513) Have you tried any of [these](http://stackoverflow.com/a/29963916/230513)? – trashgod Feb 29 '16 at 18:30

1 Answers1

0

Thanks to trashgod I realized that it's a bad idea trying to overload an header column with a checkbox when the headers are sortable too. It's better to put the checkbox outside the table.