On Fri, 27 Jun 2025 11:44:01 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> Have you checked this code? It doesn't work for me >> >> I get this whereby JRadioButtonMenuItem3 which doesnt have imageicon is not >> aligned..For this only, we need to know if other RBMIs have imageicon from >> ButtonGroup or if there any other way, let me know.. >> >>  > > No, I didn't. > > It doesn't work because the overall menu layout isn't right at the moment. If > you implement [four-column > layout](https://github.com/openjdk/jdk/pull/23324#issuecomment-3008593168): > check mark / bullet, icon, text, accelerator, it would work. Just like the > text of **MenuItem1** and **JCheckBoxMenuItem 3** would be aligned to the > text of other menu items. Probably you missed seeing it but already _5-column layout_ is implemented via [MenuItemLayoutHelper.layoutMenuItem.](https://github.com/openjdk/jdk/blob/ecd2d83096a1fea7d5086736306770bcffa4fdb6/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java#L464-L476) In the PR. `WindowsMenuItemUI.paintMenuItem` calls `MenuItemLayoutHelper.layoutMenuItem` to layout in 5 columns actually through check icon + icon + text + accelerator text + arrow icon layout via `paintCheckIcon, paintIcon, paintText, paintAccText and paintArrowIcon` call in `WindowsMenuItemUI.paintMenuItem` seems like offset value used in WindowsIconFactory paintIcon is not matching with MenuItemLayout expectation and wrong rendering is happening at slightly off position ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r2174089015