RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v6]
Alexey Ivanov
aivanov at openjdk.org
Tue Feb 4 11:26:12 UTC 2025
On Tue, 4 Feb 2025 11:13:48 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>>> Why offset is multiplied by 3?
>>
>> I believe this is likely how layout is calculated.
>>
>>> Buffered Image in test code is of size 16x16. Is it possible that the icon can be of different size?
>>
>> It's definitely possible… Yet it's pretty common to use 16×16 (small) icons in menus.
>>
>> This question is applicable to other L&Fs, yet the problem could be more prominent in Windows L&F.
>>
>>> does it depend on the icon size?
>>> If Icon size is more then I guess it may overlap with radio button skin.
>>
>> This is why we should re-work the layout of menus with icons if there's any radio- or check-menu item as I [suggested above](https://github.com/openjdk/jdk/pull/23324#discussion_r1935784688).
>
>> This is why we should re-work the layout of menus with icons if there's any radio- or check-menu item as I [suggested above](https://github.com/openjdk/jdk/pull/23324#discussion_r1935784688).
>
> Not sure I understand...As in windows11 Explorer, radiobutton checkmark and icon are at the same position as in jdk..
> what more you are suggesting to change?
Radio- or checks are in the same position but ***the icon itself** is moved to the right* so that both the bullet or check and the icon are displayed.
Currently, only the icon is rendered at the place where the bullet or checkmark are if there's no icon.
The result should like this

instead of

It is the former image that corresponds to File Explorer in Windows 11: https://github.com/openjdk/jdk/pull/23324#discussion_r1935744523
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1940990299
More information about the client-libs-dev
mailing list