RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v33]
Alexey Ivanov
aivanov at openjdk.org
Fri Jul 11 21:12:48 UTC 2025
On Fri, 11 Jul 2025 18:09:05 GMT, Phil Race <prr at openjdk.org> wrote:
> Why does height > 16 matter ? How does it make icons align ?
Perhaps, it's because standard Windows menu icons are 16×16; if the icon is larger something may need adjusting.
Yet I don't know the answer…
> src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java line 248:
>
>> 246: paintIcon(g, lh, lr, holdc);
>> 247:
>> 248: boolean isWindows11OrLater = Integer.parseInt(System.getProperty("os.name")
>
> Haven't we learned that it 'worked' on Windows 10 in an accidental and not ideal way?
> ie. it didn't really work even there.
> So do we even need to bother with this check ? Shouldn't Windows 10 do it the new way too ?
I think it worked on Windows 10 (as well as previous versions of Windows) by design, that is Windows L&F was implemented to mimic what's was common during Windows XP era which held with Windows 10 too. Yet Windows 11 changed its menu design, therefore the existing design stopped working.
> So do we even need to bother with this check ? Shouldn't Windows 10 do it the new way too ?
I'd rather go this way. Let Swing menus look consistently in Windows 10 and 11. [I suggested doing this way](https://github.com/openjdk/jdk/pull/23324#discussion_r1949596849) in February.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r2201870931
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r2201866149
More information about the client-libs-dev
mailing list