RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v26]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Jun 19 06:09:41 UTC 2025
On Wed, 28 May 2025 05:38:17 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:
>
> Text alignment fix
> > In SwingSet2, now there will be gap between bullet and text to accomodate non-existing imageicon
>
> That gap should only be there if _at least one_ menu item has an image icon. It shoudn't be there if none have an icon.
That will require to find out if current menuItem is part of ButtonGroup and then reiterate each menuitems of the ButtonGroup and see if anyone has an imageicon..It does not seem possible to find out from current menuItem if it part of ButtonGroup as that info is not passed to each MenuItemUI (ButtonGroup info is only known to application/user)
Also, assuming if we do find a way to get if this menuItem is part of a ButtonGroup, then iterating everytime to find out if any menu item has imageicon will affect performance.
Probably it's better to reserve space for imageicon even if not present..
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2986746474
More information about the client-libs-dev
mailing list