RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v24]

Phil Race prr at openjdk.org
Sat Mar 29 20:33:10 UTC 2025


On Mon, 17 Mar 2025 12:36:14 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>         mii.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_ID | MIIM_BITMAP | MIIM_CHECKMARKS;

Per 
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-menuiteminfoa

The MFT_BITMAP, MFT_SEPARATOR, and MFT_STRING values cannot be combined with one another. 
(nb MIIM is the replacement name for MFT but the same applies)

I suspect you mean to be setting
HBITMAP   hbmpChecked;
and/or
  HBITMAP   hbmpUnchecked;

not
 HBITMAP   hbmpItem;
which is used to display a bitmap instead of a text string label.

Also you aren't clearing the fMask / resetting it when using the entries without a bitmap
I have no idea how much all of this can confuse the GDI API.

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

PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2764231962


More information about the client-libs-dev mailing list