Re: How do I create a JTable with alternating background row coloring?
Posted By:
Nischala_Kale
Posted On:
Friday, April 13, 2001 02:23 PM
Extend DefaultCellRenderer, override the method public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
You can set different background colors for odd and even rows.
Also, make sure to check the isSelected flag, so you can set the background color of the selected cell correctly