RFR: 8335986: Test javax/swing/JCheckBox/4449413/bug4449413.java fails on Windows 11 x64 because RBMenuItem's and CBMenuItem's checkmark on the left side are not visible [v2]

Tejesh R tr at openjdk.org
Thu Jun 19 04:01:34 UTC 2025


On Thu, 19 Jun 2025 02:34:22 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> test/jdk/javax/swing/JCheckBox/4449413/bug4449413.java line 192:
>> 
>>> 190: 
>>> 191:         b.setOpaque(true);
>>> 192:         b.setBackground(Color.red);
>> 
>> The test is specifically for background color black, I think you need to retain background color.
>
> The original issue JDK-4449413 was for JCheckBox for black background in MetalLookAndFeel when not using OceanTheme..There was no issue found for JRadioButton, JCheckboxMenuItem, JRadioButtonMenuItem...
> 
> JDK-8075915 found issue with other L&F where it fails with "NullPointerException: Can't have null theme" because "Default Metal Theme" is not present in other L&F so initially it was set explicitly to MetalL&F but later setOpaque was added and explicit MetalL&F was removed but there was an issue with WindowL&F which was overlooked and it can be seen in the screenshot pasted in that review.
> 
> So, either we can set explicit Metal L&F 
> but I have chosen to allow other L&F with gray background for WIndows L&F (only for RB and CB MenuItem) which is because for these 2 widgets, WIndowsL&F uses [skin](https://github.com/openjdk/jdk/blob/ba32b78bfaf83f69003f83333ab6975b35343fde/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java#L904-L912) which is pre-formatted to black and cannot be color-changed based on foreground/background

Ok.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25864#discussion_r2156047549


More information about the client-libs-dev mailing list