On Thu, 22 Sep 2022 06:59:59 GMT, Tejesh R <[email protected]> wrote:
> The color returned for `InteriorBackground` property is the default color
> used for only _WindowsClassicLookAndFeel_. For _WindowsLookAndFeel_ the
> `InteriorBackground` color is not been used when checkbox paint happens. In
> _WindowsLookAndFeel_ the CheckBox check/uncheck is drawn using `ImageCache`
> which is totally independent of `InteriorBackground` color in which the user
> expects it to be.
> The proposed fix is to return null for _WindowsLookAndFeel_ (which is what
> happens in other LookAndFeel like Metal/Synth/Motif/Aqua ) and return default
> color which is the actual color used in _WindowsClassicLookAndFeel_.
test/jdk/javax/swing/JCheckBox/InteriorBackgroundTest.java line 64:
> 62: Color color = UIManager.getColor("CheckBox.interiorBackground");
> 63:
> 64: if(laf.contains("WindowsLookAndFeel") && color != null) {
Suggestion:
if (laf.contains("WindowsLookAndFeel") && color != null) {
test/jdk/javax/swing/JCheckBox/InteriorBackgroundTest.java line 67:
> 65: throw new RuntimeException("CheckBox.interiorBackground not
> Null for " +
> 66: laf);
> 67: } else if(laf.contains("WindowsClassicLookAndFeel") && color ==
> null) {
Suggestion:
} else if (laf.contains("WindowsClassicLookAndFeel") && color == null) {
-------------
PR: https://git.openjdk.org/jdk/pull/10385