Edit JTable in Netbeans Builder

868 views Asked by At

I designed a JTable with Netbeans Builder and I created 5 columns, the 5th one is Boolean so I want to know how to highlight whole the row when the user selected.

enter image description here

1

There are 1 answers

4
camickr On

See Table Row Rendering for an easy way to color an entire row based on a value in the row.

The problem now is that only the cell is automatically repainted when you click on the checkbox so you will also need to add a TableModelListener to the TableModel so you can invoke a repaint() on the table row whenever the state of the checkbox is changed.