Row header in JTable with same drag/drop behaviour as column header

209 Views Asked by At

I'm trying to have row headers in my JTable which have similar behaviour to the column headers, especially for the drag and drop part.

Something like this: JTable Row Header Implementation

And when I drag the row header, it should have the same visual effect as when I drag the column header and the same result (row/column is moved).


So far, one way I thought of is to create my own custom BasicTableHeaderUI and implement the paint() method. Not sure if that will cause problems if other look and feels were used?

1

There are 1 best solutions below

0
On

You can add D&D listener to table cells or whole table, and than pass the event to EventHandler that handles D&D events on header.