6882917: Nimbus and DefaultTableCellRenderer: must start with normal background
Reviewed-by: rupashka
--- 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