1

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.

By-Jokese
  • 148
  • 1
  • 4
  • 13
  • 1
    You could create a cell renderer which added a `MatteBorder` to the right of the first cell and the left of the next...For [example](http://stackoverflow.com/questions/28891982/jtable-returning-null-for-graphics/28892333#28892333) – MadProgrammer Apr 10 '15 at 11:10
  • *"I want to add a divider between 2 rows"* Why? What's the distinction between the data above and below the divider line? – Andrew Thompson Apr 10 '15 at 11:16
  • Yes is to distinct between 2 groups of data that has the same columns. – By-Jokese Apr 10 '15 at 11:26
  • *"to distinct between 2 groups of data"* **What** is the distinction? If I were a user looking at your app., how would the data look different? E.G. above the line is 'failed test' below line is 'passed test'? Above the line is states of North America, while below is states of other countries in the Armericas? What..? – Andrew Thompson Apr 10 '15 at 11:50
  • Look, group1 of data (some numbers) **/ divider /** Group2 (total of the operation between group1). – By-Jokese Apr 10 '15 at 12:10

1 Answers1

2

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

Community
  • 1
  • 1
Catalina Island
  • 7,027
  • 2
  • 23
  • 42