RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v18]
Alexey Ivanov
aivanov at openjdk.org
Thu Mar 6 19:32:00 UTC 2025
On Wed, 5 Mar 2025 03:13:32 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon.
>> If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Review comment fix
I can quickly answer to this part:
> Surely that isn't a Windows 10 vs Windows 11 issue ?? Unless it is an accidental by-product of some layout problem ?
It is a Windows 10 vs Windows 11 issue.
Currently, an `ImageIcon` associated with a radio- or check menu item is painted instead of the bullet or check-mark. The selected state of the corresponding menu item is still apparent since the background of the icon is darker.

This is a screenshot from [the discussion above](https://github.com/openjdk/jdk/pull/23324#issuecomment-2640591767). Here the purplish background around icon indicates the selected state.
In Windows 11, there's no way to distinguish whether a radio- or check menu item is selected or not because the selection background is gone in Windows 11 style.
Prasanta found a menu in Windows File Explorer, the **View** button on the toolbar, which displays both the radio bullet and an icon to the left of menu text.

No one has found a similar usage in Windows 10. Other apps, Oracle VirtualBox and Paint.NET, which draw icons in menu items add a small check-mark to the icon to indicate the menu item is selected.
As far as I'm aware Win32 menus don't allow displaying both an icon and a bullet or check-mark; apps have to custom-draw such menu items.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2704755835
More information about the client-libs-dev
mailing list