diff --git a/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java b/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java index 1b8cf9894465b4c8f915973d8176c014cb96d407..dcd6b6275bf4c969571e386cb7136945eb7fe1d5 100644 --- a/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java +++ b/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java @@ -638,7 +638,7 @@ class SynthTableUI extends BasicTableUI implements SynthUI, if ((b == null || b instanceof UIResource || component instanceof SynthBooleanTableCellRenderer) && !table.isCellSelected(row, column)) { - if (alternateColor != null && row % 2 == 0) { + if (alternateColor != null && row % 2 != 0) { component.setBackground(alternateColor); } } diff --git a/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java b/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java index 07e7265c9bf6d6bcee3b78efa4ec40e36e2b46db..0c2b6a97367f4a101bf1fa0d5c09d87d1a2bafab 100644 --- a/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java +++ b/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java @@ -214,8 +214,9 @@ public class DefaultTableCellRenderer extends JLabel : table.getBackground(); if (background == null || background instanceof javax.swing.plaf.UIResource) { Color alternateColor = DefaultLookup.getColor(this, ui, "Table.alternateRowColor"); - if (alternateColor != null && row % 2 == 0) + if (alternateColor != null && row % 2 != 0) { background = alternateColor; + } } super.setForeground(unselectedForeground != null ? unselectedForeground