You need to extend the DefaultTableCellRenderer and handle setting the color.
Here is what you need to do for setting alternate strips of red.
For more examples visit,
http://www.javareference.com/jrexamp...jsp?rootcat=10
public class ColorCellRenderer extends DefaultTableCellRenderer
{
public Component getTableCellRendererComponent
(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column)
{
super.getTableCellRendererComponent
(table, value, isSelected, hasFocus, row, column);
if (!isSelected)
{
if (row % 2 == 0)
setBackground(Color.red);
else
setBackground(table.getBackground());
}
return this;
}
}
Rahul.
[email protected]
--------------------------
http://www.javareference.com