On Tue, 2 Jun 2026 05:43:19 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 incrementally with three 
> additional commits since the last revision:
> 
>  - Fix
>  - Fix
>  - Static usage removed

test/jdk/javax/swing/JMenuItem/TestRadioAndCheckMenuItemWithIcon.java line 78:

> 76:         a checkmark is shown alongside the imageicon.
> 77: 
> 78:         Also, verify the JMenuItem "MenuItem2" red square imageicon 
> location.

This test doesn't cover the case where we have icons and checks sharing a 
column.
That is one of the key things we need to test.
Also that is very specific to the Windows L&F and this test currently is not.
It just sets the system L&F. (Did you test GTK & Aqua too )?

I think that on windows it needs to add a 2nd menu and extra instructions for 
that special windows case.

Also the instructions could use some updates. 
Starting with the first line which says
"A top level Menu will be shown."
better would be
"A window is displayed which has a Menu on the menu bar."

and I'd say "icon" not "imageicon" or at least "image icon" ...

And "vertically aligned" could be misconstrued.
Perhaps say something like "the red square images are not all the same size but 
should their left edges should  all be aligned".

BTW this presumes LTR layout and I suggested that we need to test RTL too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29730#discussion_r3351795114

Reply via email to