Jonathan Viccary Jonathan Viccary - 6 months ago 23
Java Question

Removing gridlines from a table in Java but leaving a whole row the same color

I have used

on a table to repaint cells so that every alternate row in a table is a different color, however, when I use
it removes the grid lines but allows the background color of the table to show through where the grid lines used to be, not the color of the cells in that row.

Is there a way to color these grid lines? Or do I need a better method of coloring the alternate rows?


You removed the lines but left the spacing. Removing the spacing should work.

jTable.setIntercellSpacing(new Dimension(0,0));