RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v18]

Alexey Ivanov aivanov at openjdk.org
Fri Mar 7 13:27:56 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

Comparing side by side:

| Windows 10 | Windows 11 |
|---------------|---------------|
| ![A menu rendered by Swing in Windows 10: the first menu item has purplish background around the red square to indicate it's selected; the third menu item has purplish background around the cyan square to indicate it's selected; the fourth menu item renders the default check-mark which also has purple background; the fifth menu item renders a green square as its icon; all the icons are aligned.](https://github.com/user-attachments/assets/684c9461-e47e-46de-a609-7bd9724099cb) |  ![The same menu rendered by Swing in Windows 11: there are no purplish background around icons so it's impossible to tell if a menu item with custom icon is selected or not, it's true for the first (radio) menu item and the third (check) menu item; the fourth menu item displays the default check-mark to indicate selection, there's no special background around the check-mark.](https://github.com/user-attachments/assets/6db3905c-1682-42b4-99cb-8edd7f58a2ba) |

This is how Swing currently renders the same menu in Windows 10 and 11.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2706450223


More information about the client-libs-dev mailing list