Skip to content

8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel #26717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: jdk25
Choose a base branch
from

Conversation

prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Aug 10, 2025

Hi all,

This pull request contains a backport of commit [e29346db](https://github.com/openjdk/jdk/commit/e29346dbd6328dcadc347a70d8c06ce141efef02) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository.

The commit being backported was authored by Prasanta Sadhukhan on 7 Aug 2025 and was reviewed by Phil Race, Alexander Zuev and Abhishek Kumar.

The issue is a manual JCK test fails due to lack of demarcation between selected and unselected JRadioButtonMenuItem and JCheckboxMenuItem whereby JDK does not draw bullet/checkmark in WIndows 11 if imgage icon is present as the (position) offset to draw them is same as the image icon position.
Fix is made to ensure the bullet/checkmark is drawn followed by image icon followed by menu text so that user can distinguish between selected and deselected radiobutton/checkbox menuitem

CI testing and manual conformance test along with SwingSet2 demo testing is ok


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel (Bug - P1)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26717/head:pull/26717
$ git checkout pull/26717

Update a local copy of the PR:
$ git checkout pull/26717
$ git pull https://git.openjdk.org/jdk.git pull/26717/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26717

View PR using the GUI difftool:
$ git pr show -t 26717

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26717.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 10, 2025

👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into jdk25 will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 10, 2025

@prsadhuk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel

Reviewed-by: prr, aivanov

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the jdk25 branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the jdk25 branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title Backport e29346dbd6328dcadc347a70d8c06ce141efef02 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel Aug 10, 2025
@openjdk
Copy link

openjdk bot commented Aug 10, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Aug 10, 2025
@openjdk
Copy link

openjdk bot commented Aug 10, 2025

@prsadhuk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added client [email protected] rfr Pull request is ready for review labels Aug 10, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 10, 2025

Webrevs

@prsadhuk
Copy link
Contributor Author

/touch

@openjdk
Copy link

openjdk bot commented Aug 10, 2025

@prsadhuk The pull request is being re-evaluated and the inactivity timeout has been reset.

@liach
Copy link
Member

liach commented Aug 10, 2025

@prsadhuk We have entered release candidate phase for 25. Only P1 bugs may be fixed with approval. This bug has been present in JDK 8, so I wonder if there is such a critical need at this time. I wonder if you have considered backporting to 25u instead, like 25.0.2.

Also, please close the incorrect version of this backport at #26716.


public static void setAcceleratorSelectionForeground(Color acceleratorSelectionFg) {
acceleratorForeground = acceleratorSelectionFg;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pointed this out on the main bug but this looks like a copy/paste error.
It should be acceleratorSelectionForeground.

To Alexei's point, why can't we pass these as parameters ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the assignment..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the assignment..

This may be an appropriate quick fix at this moment.

Yet this bug needs fixing in mainline, all the update releases will also be affected as soon as JDK-8348760 is backported.

I've submitted JDK-8365375: Method SU3.setAcceleratorSelectionForeground assigns to acceleratorForeground.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the assignment..

This may be an appropriate quick fix at this moment.

Yet this bug needs fixing in mainline, all the update releases will also be affected as soon as JDK-8348760 is backported.

I expect, and recommend, that the back ports be based on the JDK 25 version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the assignment..

This may be an appropriate quick fix at this moment.
Yet this bug needs fixing in mainline, all the update releases will also be affected as soon as JDK-8348760 is backported.

I expect, and recommend, that the back ports be based on the JDK 25 version.

The backports are nearly done, so it's impossible to add this small fix at this time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well they'll have to be re-done. That's life.

@openjdk openjdk bot removed the clean Identical backport; no merge resolution required label Aug 12, 2025
Copy link
Contributor

@prrace prrace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whilst a couple of follow on bugs have been filed, which will be fixed in a later release, SFAIK there is no new functional issue with this fix and it resolves the TCK failure.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Port of a pull request already in a different code base client [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants