<Swing Dev> [9] Review request for 8057791: Selection in JList is drawn with wrong colors in Nimbus L&F
Anton Litvinov
anton.litvinov at oracle.com
Sun Jun 12 21:12:52 UTC 2016
Hello,
Could you please review the following fix for the bug.
Bug: https://bugs.openjdk.java.net/browse/JDK-8057791
Webrev: http://cr.openjdk.java.net/~alitvinov/8057791/jdk9/webrev.00
The bug is the fact that selected elements in "javax.swing.JList"
component are drawn with wrong background and foreground colors, though
"JList.getSelectionForeground()", "JList.getSelectionBackground()"
methods return the correct color values for the tested JList instance.
Wrong colors are returned in run time from the method
"javax.swing.plaf.synth.SynthStyle.getColor" for
"javax.swing.plaf.synth.SynthListUI.SynthListCellRenderer" instance,
because it can be only in 1 state "SynthConstants.ENABLED" and cannot be
in "SynthConstants.SELECTED" state, therefore the call from this method
to "javax.swing.plaf.nimbus.NimbusStyle.getColorForState(SynthContext,
ColorType)" method always returns some wrong default L&F foreground,
background colors which are observed in this bug.
All automatic regression tests from open and closed sets located in
"javax/swing/JList", "javax/swing/plaf/nimbus" directories were run on
MS Windows 7 OS during verification of the fix.
Thank you,
Anton
More information about the swing-dev
mailing list