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

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Feb 10 05:31:15 UTC 2025


On Fri, 7 Feb 2025 05:26:10 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 two additional commits since the last revision:
> 
>  - remove test file
>  - Move text position w.r.t menuItem icon

> This is how it looks on Windows 10: ![latest-fix-2025-02-07](https://private-user-images.githubusercontent.com/70774172/411051067-55ce3491-e52b-4491-93a8-1a3ebd686840.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTMwNjksIm5iZiI6MTczOTE1Mjc2OSwicGF0aCI6Ii83MDc3NDE3Mi80MTEwNTEwNjctNTVjZTM0OTEtZTUyYi00NDkxLTkzYTgtMWEzZWJkNjg2ODQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDAxNTkyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcyMjQ2YmE0NGQwYTQyNzk4Mzg3ZjI4MjlmOTc1OWVmYjIzZGRiNjJlMjdiOWJlMGFkMTFkZTU2YTljZGY4ODImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mmOJXNV329OKGu6gq-vVTlE4GsfEgQIAD-FR7li12U4)
> 
> It's close, yet the spacing is wrong.
> 
> The bullet / check-mark should be where they were before the fix. There was 8-pixel margin to the left of selected bullet background before the fix, now there are only 2 pixels.
> 
> The margin between the bullet background and the text was again 8 pixels, I think we should maintain the same margin between the bullet and the icon as well as between the icon and the menu text.

Does bullet/checkmark use to appear before the fix in windows 10? I thought you told the icon was getting highlighted/dehighlighted depending on item is selected or not

I am not sure if we can make 8 pixel margin as it will cause MenuItem text or bullet to be outgrow popmenu width ( I faced this issue while experimenting with spacing), which I am not sure if and where we can increase.

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

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


More information about the client-libs-dev mailing list