On Thu, 19 Feb 2026 03:34:55 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";
>>  />
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Fix

I want to make sure we are all on the same page as to what the result should be.

Let's try to write it down. If there's anything not right in the following, let 
me know and I'll edit it.

There are the following possible elements in an item and in LTR mode they 
should be presented in the order stated

* radiobutton/checkmark - left aligned
* image(icon) - left aligned
* menu text - left aligned
* menu accelerator keys - right aligned
* submenu arrow - right aligned

- No space should be reserved for any element where no item in the menu 
contains it.
- All columns of a particular type should be aligned
- if no item has both an image and check/radio, but some items have one of 
these, they share a column (I think that was what we agreed in the original 
long running PR)
- in RTL mode, it is the exact reverse (you'll need to confirm this is what 
Windows does)
- If any menu item is updated (eg to add/remove one of the element types), the 
layout of the entire menu needs to be re-evaluated to preserve the rules.
- The menu item should not be overly compressed : aesthetic spacing should be 
visible between each element type. 

Can you provide screen shots of some of the most important cases, in particular
- menu where items are all text only 
- menu where all items have text and one item additionally has a checkmark
- menu where all items have text and one item additionally has an image icon
- menu where all items have text and
    * one item additionally has an image icon
    * one item additionally has a checkmark (or radio button)
- what a submenu looks like that uses an image and very long text
    * SFAIK, these can never have a check mark, but can have everything else

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

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

Reply via email to