RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v5]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Jan 30 13:30:46 UTC 2025
On Thu, 30 Jan 2025 13:11:50 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>>> Do you happen to know why State.BITMAP was originally here?
>>
>> Perhaps, because of default Windows behaviour: a bitmap menu item fully replaces the menu item text. Yet I can't be sure…
>
> This state was added by [JDK-6432667](https://bugs.openjdk.org/browse/JDK-6432667): _Vista: Menu dropdown differs while compare with native in vista laf_.
>
> No more background is available… It may be due to how Windows renders icons in menus: if a menu item has an icon, it's rendered at the location where bullets / check-marks are rendered; if you need to display selected / unselected state of such a menu item, you have to use different icons.
The bug says
> in case icon is defined for JCheckBoxMenuItem or
> JRadioButtonMenuItem this icon is used as a check/radio mark. themed
> background is used to show the selection.
so I guess it was done intentionally to not draw checkmark if icon is there, but I am not getting any menuitem with icon and radiobutton selection natively in windows11 to compare..anything in windows10?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1935612704
More information about the client-libs-dev
mailing list