RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v9]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Fri Feb 7 03:12:15 UTC 2025
On Tue, 4 Feb 2025 14:16:16 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:
>
> retain diff of OFFSET between skin background start coord and skin coordinate
> I tested it on Windows 11 and 10.
>
> **Windows 11**  It looks reasonably well…
>
> But it doesn't look like the menu in Windows 11 File Explorer, does it?  Windows L&F should look like native apps do, and we're not there yet with the menu rendering.
>
> **Windows 10**  It looks bad because neither icon is where it should be.
>
> Without the fix, it looks good:  And one can see if an item is selected or not. Yet they changed the skin in Windows 11, now it's impossible to distinguish them.
I am not sure if we can satisfy both windows 10 and windows 11 simultaneously as both design is different for this logic...
Without the fix, it looks good as Windows 10 as it doesn't support separate bullet/checkmark skin whereas windows 11 does...Also, its difficult to test for me as I do not have windows 10 so any change for windows 11 whether it works for windows10 is difficult to make out, also considering the fact mainline jdk is not supporting windows10 so not sure why we should introduce additional logic to satisfy windows10
Also, Windows 11 there is another thing I noticed which is without icon, the bullet/checkmark is drawn at the icon location and do not have its own space, so we need to bring back the if (icon == null) logic which we removed to render the skin always at specified location..
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2641830140
More information about the client-libs-dev
mailing list