RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v29]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Tue Aug 12 04:17:24 UTC 2025
On Mon, 11 Aug 2025 16:27:20 GMT, Phil Race <prr at openjdk.org> wrote:
>> It was the same calculation used in `BasicMenuItemUI `which is now moved to `SwingUtilities3 `so that it can be called from Basic and `WindowsMenuItemUI `to avoid code duplication....you can compare the contents before the fix.....in this specific case, `rect.x` is inclusive of `insets.left`..
>>
>> Similarly other SwingUtilities3 changes are also as it was in BasicMenuItemUI, it was just moved verbatim from BasicMenuItemUI to it so that it can be called from both Basic and WindowsMenuItemUI class with no changes..nothing more and nothing less...probably it can be optimized but I wanted to keep the call and the content in each method in SwingUtilities3 same as it was in BasicMenuItemUI
>
> They can be added parameters to SU3.paintAccText.
Since we needed to move the `paintIcon`, `paintCheckIcon`, `paintAccText`, `paintText `and `paintArrowIcon `from `BasicMenuITemUI` to `SwingUtilties3` so that it can be called from `WindowsMenuItemUI` and `BacisMenuItemUI `to avoid code duplication, I had to made these methods static since these methods are called from `paintMenuItem` which is needed to be called from `WindowsCheckBoxMenuItemUI`, `WindowsRadioButtonMenuItemUI`, `WindowsMenuUI `via `WindowsMenuItemUI.paintMenuItem` and because the methods were static the variables accessed by it also needed to be static to avoid build issues
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r2268532062
More information about the client-libs-dev
mailing list