RFR: 8370945: With Windows LAF, the location of a JMenuItem icon is incorrect [v3]

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Feb 23 01:26:09 UTC 2026


On Thu, 19 Feb 2026 03:34:55 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> [JDK-8348760](https://bugs.openjdk.org/browse/JDK-8348760) fixed an issue in Windows L&F JMenuItem layout whereby radio bullet/checkmark was rendered in different columnspace than menuitem imageicon so radiobullet/checkmark is rendered in first column and imageicon is rendered in 2nd column but this rendering of imageicon in 2nd columnspace was done invariably for all JMenuItem irrespective of if it is JRadioButtonMenuItem or JCheckBoxMenuItem or JMenuItem, which is wrong.
>> 
>> Normal JMenuItem (which are not JRadioButtonMenuItem or JCheckBoxMenuItem) imageicon rendering should be done in first columnspace as was done before JDK-8348760 fix because there is no radiobullet/checkmark to render for those menuitems so no need to reserve columnspace for those bullet/checkmark icon
>> 
>> Before fix
>> 
>> <img width="205" height="127" alt="image" src="https://github.com/user-attachments/assets/13a1e352-5e8d-4251-b7a7-032935eab74e" />
>> 
>> 
>> After fix
>> 
>> <img width="195" height="131" alt="image" src="https://github.com/user-attachments/assets/84ec3ee6-2823-4bf7-840d-b53f2e9d44c3" />
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix

Reverted the text alignment to have vertical alignment as before, but kept the JMenuItem imageicon alignment as it seems to be at par with native app for normal non-radio/non-check JMenuItem (as mentioned here https://github.com/openjdk/jdk/pull/29730#issuecomment-3919123593) and this JBS is about that only..

<img width="415" height="387" alt="image" src="https://github.com/user-attachments/assets/4b5f11d8-cade-4f07-8cb3-cc188a994a73" />


> They do need to be aligned. Anything else is weird.

It was aligned before this PR and so I closed this JBS as Not an Issue but it was reopened..

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

PR Comment: https://git.openjdk.org/jdk/pull/29730#issuecomment-3942093367


More information about the client-libs-dev mailing list