On Fri, 27 Jan 2023 10:26:10 GMT, Prasanta Sadhukhan <[email protected]> wrote:
> When the Action.SELECTED_KEY property action is assigned to ToggleButton and > an accelerator key binding is mapped to the action, then pressing the > accelerator key binding does not toggle the toggle button. > This is because SwingUtilities.notifyAction does not fire itemStateChanged > event for such action related to SELECTED_KEY. > Fix is to get the Action.SELECTED_KEY command/action and fire > itemStateChanged Event via JToggleButton.setSelected() call to notify > propertyChange listener of the toggled property. Apart from jtreg test comment, other changes looks good. Verified regression test also. test/jdk/javax/swing/JToggleButton/TestSelectedKey.java line 26: > 24: /* @test > 25: @bug 6817009 > 26: @summary Verifies if AAction.SELECTED_KEY not toggled when using key > binding This is a headful test, we need to add @headful tag. Also summary needs to be updated to something like "Verifies that AAction.SELECTED_KEY is not toggled when key binding is used" ------------- Marked as reviewed by jdv (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/12253#pullrequestreview-1353989725 PR Review Comment: https://git.openjdk.org/jdk/pull/12253#discussion_r1145780398
