Jonathan Viccary Jonathan Viccary - 1 year ago 57
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?

Answer Source

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

jTable.setIntercellSpacing(new Dimension(0,0));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download