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

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Mar 14 15:02:01 UTC 2025


On Thu, 6 Mar 2025 18:59:23 GMT, Phil Race <prr at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review comment fix
>
> There is a lot to absorb here. I don't want to get into line by line code discussion, we need to have the big picture right first.
> 
> (1) This affects all releases, right ? The evaluation in the bug report is non-existent.
> I expect to see a full description of how it came about (history) what the consequences are,
> what the options are etc. Without that the PR is in a vacuum.
> 
> (2) My rough understanding is that this was "observed" because of a change in Windows 11 vs earlier Windows versions
> with the highlighting of the radio button .. but the fix has some how become focused on the ImageIcon ?
> If I don't have this right, give me a clear and complete explanation of the issue (ie part of the missing evaluation)
> 
> Surely that isn't a Windows 10 vs Windows 11 issue ?? Unless it is an accidental by-product of some layout problem ?
> I am seeing code in the pre-fix side of the diff that does paint an icon .. so I am not sure I understand.
> If the same control in native windows doesn't allow such an icon, then we are within our rights to ignore it.
> There are a bunch of settings, such as b/g color etc that various L&Fs ignore if they aren't appropriate.
> Search the javax.swing javadoc for the word "ignore" and you'll find hundreds of matches.
> 
> I can't actually tell from the PR description what the inentention is
> "Added provision of drawing the radiobutton windows Skin even when imageIcon is present."
> 
> Does that mean it continues to ignore the imageicon - ie not render it ? But as I wrote there is something that looks to be painting an icon. Maybe we are talking about the "icon" that is actually the rendering of the radio button - not an application supplied imageicon ?
> I'd like 100% clarity here.
> 
> (3) Any fix requiring a CSR would be a problem - at least if it is SE spec significant, because it seems like this fix needs to be backported all the way to 8u. If there is a *better* fix that requires a CSR for the future, we can do that as a follow-on for JDK 25 only, but we should start with what can be backported, and do the better fix as a follow-on.
> 
> I'll deviate  slightly from my "I won't get in to lines for code here", and say that FWIW the current fix isn't what I'd like to see.
> Putting a check for Windows L&F in a BasicUI class ?? We had a similar issue with GTK some months ago and it was something that we managed to avoid. Isn't there a Windows L&F sub-class we can do this in ??
> 
> (4) We are not any time soon de-supporting Windows 10.
> Windows 10 is still supported by M...

@prrace I dont see checkmark/radio bullet with imageicon in WinGDI...
CheckMenuRadioItem is there in win32 API but is not called in our windows native. It does not have provision of having image icon passed to it.
In JDK, I can only see DrawFrameControl with DFCS_BUTTONCHECK/DFCS_BUTTONRADIO which is called from awt.
AWT spec has only CheckboxMenuItem and no RadioMenuItem and CheckboxMenuItem also does not have provision of drawing image icon, 
so it seems to be only Swing provision to have image icon alongside radio bullet/checkmark and getting Part.MP_POPUPCHECKBACKGROUND skin to show the background around icon/checkmark/bullet is not working in Windows11 as it was doing in WIndows10..
If we are not supposed to follow WIndows FileExplorer, not sure how to represent selection of the radiobutton/check menuitem

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

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


More information about the client-libs-dev mailing list