[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";
 />

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

Commit messages:
 - jcheck
 - 8370945: With Windows LAF, the location of a JMenuItem icon is incorrect

Changes: https://git.openjdk.org/jdk/pull/29730/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29730&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8370945
  Stats: 145 lines in 3 files changed: 135 ins; 2 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/29730.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29730/head:pull/29730

PR: https://git.openjdk.org/jdk/pull/29730

Reply via email to