Rob Prime wrote:I solved this once by simply adding a column at the start of my TableModel, then giving that column a special TableCellRenderer which mimics the look&feel of the table header, and adding a mouse listener to the table to handle clicks on that column.
The feature that this approach lacks is to have the row header not scroll with the rest of the table. Or rather, to scroll up/down with the table but to stay put when scrolling left/right.
For that, typically a one-column table is added to the west side of table's scroll pane via JScrollPane.setRowHeader(). This is reasonably simple so long as the rows of the main table are all the same height.