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

Abhishek Kumar abhiscxk at openjdk.org
Wed Mar 12 10:44:59 UTC 2025


On Wed, 12 Mar 2025 07:43:17 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon.
>> If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Expand wildcard imports

minor formatting changes.

Thank you removing the unneeded methods as we discussed.

src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java line 159:

> 157: 
> 158:     public static void applyInsets(Rectangle rect, Insets insets) {
> 159:         if(insets != null) {

Suggestion:

        if (insets != null) {

src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java line 219:

> 217:             if (!model.isEnabled()) {
> 218: 
> 219:                 // *** paint the accText disabled

Suggestion:

                // paint the accText disabled

src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java line 237:

> 235:             } else {
> 236: 
> 237:                 // *** paint the accText normally

Suggestion:

                // paint the accText normally

test/jdk/javax/swing/JMenuItem/TestRadioAndCheckMenuItemWithIcon.java line 54:

> 52: 
> 53: 
> 54: import java.io.File;

unused import

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

PR Review: https://git.openjdk.org/jdk/pull/23324#pullrequestreview-2677893179
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1991164053
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1991172598
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1991174571
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1991186609


More information about the client-libs-dev mailing list