public TaskTableSorter(TaskTable table) { JTableHeader tableHeader = table.getTableHeader(); tableHeader.addMouseListener(new MouseHandler()); tableHeader.setDefaultRenderer(new SortableHeaderRenderer()); }
public void allowSortColChange(boolean allow) { JTableHeader hdr = table.getTableHeader(); if (allow && !allowSortColChange) hdr.addMouseListener(allowSortColChangeMouseListener); else if (!allow && allowSortColChange) hdr.removeMouseListener(allowSortColChangeMouseListener); allowSortColChange = allow; }