Search code examples
javaswingjtabledivider

Horizontal divider in a Jtable


I have a Jtable with several columns and rows. And I want to add a divider between 2 rows, like this but in horizontal: colum divider

Any idea? I know that I could create another empty row, as a divider. but Is any way to do like the image? but horizontal.

Thanks.


Solution

  • You can override prepareRenderer(), like they show here, and add a MatteBorder to the bottom when the row matches the one you want.