提交 c1a7cd13 编写于 作者: P peterz

6882917: Nimbus and DefaultTableCellRenderer: must start with normal background

Reviewed-by: rupashka
上级 24b614b1
...@@ -638,7 +638,7 @@ class SynthTableUI extends BasicTableUI implements SynthUI, ...@@ -638,7 +638,7 @@ class SynthTableUI extends BasicTableUI implements SynthUI,
if ((b == null || b instanceof UIResource if ((b == null || b instanceof UIResource
|| component instanceof SynthBooleanTableCellRenderer) || component instanceof SynthBooleanTableCellRenderer)
&& !table.isCellSelected(row, column)) { && !table.isCellSelected(row, column)) {
if (alternateColor != null && row % 2 == 0) { if (alternateColor != null && row % 2 != 0) {
component.setBackground(alternateColor); component.setBackground(alternateColor);
} }
} }
......
...@@ -214,8 +214,9 @@ public class DefaultTableCellRenderer extends JLabel ...@@ -214,8 +214,9 @@ public class DefaultTableCellRenderer extends JLabel
: table.getBackground(); : table.getBackground();
if (background == null || background instanceof javax.swing.plaf.UIResource) { if (background == null || background instanceof javax.swing.plaf.UIResource) {
Color alternateColor = DefaultLookup.getColor(this, ui, "Table.alternateRowColor"); Color alternateColor = DefaultLookup.getColor(this, ui, "Table.alternateRowColor");
if (alternateColor != null && row % 2 == 0) if (alternateColor != null && row % 2 != 0) {
background = alternateColor; background = alternateColor;
}
} }
super.setForeground(unselectedForeground != null super.setForeground(unselectedForeground != null
? unselectedForeground ? unselectedForeground
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册