F
Felix Natter
hallo,
I have a JTable with fixed footer and header rows, implemented by using
three JTables in a vertical BoxLayout which share a common
TableColumnModel. All the data is stored in a few custom TableColumn's,
instead of in the TableModel (TableModel.getValueAt returns null). The
custom TableColumn's also implement TableCellRenderer so that they
create the cell renderer widgets (some custom, many JLabel's).
Now when I use:
middletable.setAutoCreateRowSorter(true);
I can click on the header fields, but when I do it is indicated that
*all* columns are sorted ascending/descending, and it doesn't do any
sorting (probably because the Tablemodel doesn't store any data?).
Is there another way, maybe on a lower level, to do the sorting?
Is there a way to catch mouse clicks on header cells so that I can do it
manually by keeping an index array for all TableColumn's and inserting
Unicode chars for "sorted ascending"/"sorted descending" in the header
cell? Would Component.processMouseEvent() in combination with
JTableHeader.columnAtPoint() be the right direction?
Thanks a lot in advance!
I have a JTable with fixed footer and header rows, implemented by using
three JTables in a vertical BoxLayout which share a common
TableColumnModel. All the data is stored in a few custom TableColumn's,
instead of in the TableModel (TableModel.getValueAt returns null). The
custom TableColumn's also implement TableCellRenderer so that they
create the cell renderer widgets (some custom, many JLabel's).
Now when I use:
middletable.setAutoCreateRowSorter(true);
I can click on the header fields, but when I do it is indicated that
*all* columns are sorted ascending/descending, and it doesn't do any
sorting (probably because the Tablemodel doesn't store any data?).
Is there another way, maybe on a lower level, to do the sorting?
Is there a way to catch mouse clicks on header cells so that I can do it
manually by keeping an index array for all TableColumn's and inserting
Unicode chars for "sorted ascending"/"sorted descending" in the header
cell? Would Component.processMouseEvent() in combination with
JTableHeader.columnAtPoint() be the right direction?
Thanks a lot in advance!