changeset 1917:fc3997fd1bce

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