changeset 4283:06d5378aaff3

6882917: Nimbus and DefaultTableCellRenderer: must start with normal background Reviewed-by: rupashka
author peterz
date Wed, 18 Nov 2009 17:36:46 +0300
parents ac32f2a927e0
children 12d5126755c0 ef21a120cb18
files jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Wed Nov 18 12:58:02 2009 +0300
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Wed Nov 18 17:36:46 2009 +0300
@@ -638,7 +638,7 @@
             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);
                 }
             }
--- a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java	Wed Nov 18 12:58:02 2009 +0300
+++ b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java	Wed Nov 18 17:36:46 2009 +0300
@@ -214,8 +214,9 @@
                                     : 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