On Wed, 13 May 2026 04:51:27 GMT, Prasanta Sadhukhan <[email protected]> 
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";
>>  />
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Prasanta Sadhukhan has updated the pull request with a new target base due to 
> a merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains five additional 
> commits since the last revision:
> 
>  - Merge branch 'master' of https://git.openjdk.java.net/jdk into JDK-8370945
>  - Fix
>  - Text alignment
>  - jcheck
>  - 8370945: With Windows LAF, the location of a JMenuItem icon is incorrect

"This left padding is there before fix too. This is what it looked in jdk9"

After some off-line discussion, some of us think that this is not exactly 
accurate. The current fix is always reserving two columns. JDK 9 (and crucially 
Windows) only  unconditionally reserves one column 

I've updated my "rules" above on this and added some more details, I'll paste 
it here too
One column should be always reserved as space for an icon or checkmark, even if 
no item uses either. This column can therefore be completely empty, like in JDK 
9 and windows native.
-     ** this means column one can be used for an icon in some items, and a 
check mark in other items
- A 2nd column for icon or checkmark should only appear if SOME menu item uses 
both icons and checkmarks. Therefore this 2nd column can NEVER be completely 
empty.
- If we have 2 columns, the first column should be used for checkmarks, the 2nd 
for icons, they are not mixed in this 2 column case.

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

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

Reply via email to