RFR: 8373650: Test javax/swing/JMenuItem/6458123/ManualBug6458123.java fails because the check icons are not aligned properly as expected [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Jan 2 09:58:56 UTC 2026


> Check/radiobutton icon are not aligned properly in RTL. `WindowsMenuItemUI `uses `MenuItemLayoutHelper.layoutMenuItem` to do the layout which calls `doRTLColumnLayout `which calculates x positions in `calcXPositionsRTL `and then again aligns in `alignRects`. However, since in Windows historically radiobutton/check icon was not drawn or drawn below the menuitem image icon (since image icon and check icon was drawn in the same layout space and not separately) the aligned x position of check icons returned from `MenuItemLayoutHelper` was not correct but since `MenuItemLayoutHelper` alignment is used in other L&Fs also so we need to realign it in windows specific class i.e in WindowsIconFactory in paintIcon
> 
> Before fix
> 
> <img width="425" height="646" alt="image" src="https://github.com/user-attachments/assets/6aac649d-b099-4e11-ba9a-83c623034287" />
> 
> After fix
> 
> <img width="430" height="641" alt="image" src="https://github.com/user-attachments/assets/e0ea7e3e-d6cb-44a6-aa4f-78435f85d6fb" />

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  Alignment fix

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28889/files
  - new: https://git.openjdk.org/jdk/pull/28889/files/f0b99274..bb174e9b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28889&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28889&range=00-01

  Stats: 12 lines in 1 file changed: 6 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/28889.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28889/head:pull/28889

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


More information about the client-libs-dev mailing list