On Wed, 12 Feb 2025 15:49:37 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> @aivanov-jdk I think we should not change RadioButton's implementation as >> the announcement is not consistent. >> Do you have any other suggestion ? > > @kumarabhi006 Sorry the long delay. > > I tested the behaviour of radio buttons and I can't see or hear any > difference in announcements when the same condition, namely > `!Objects.equals(newValue, oldValue)`, is used before calling > `valueChanged(ptr)`. > > I added a panel with three radio buttons to your test case. Initially all the > buttons aren't selected. VoiceOver announces when I move to the first radio > button. It also announces when I move between radio buttons with left and > right arrows. Then when I press the <kbd>Space</kbd> key, the current radio > button gets selected and this is announced by VoiceOver: selected, <the > caption of the button>. When I move to another button with arrow keys, it > doesn't get selected right away when VoiceOver is active, and VoiceOver > announces that I moved to another button and that it's not selected. Pressing > the <kbd>Space</kbd> key selects the currently active button. > > What do you hear when testing such a scenario? Tested with SwingSet2, and I can hear the difference in announcements. It looks the difference comes from the focus events: when the old button loses focus, `valueChanged` isn't called currently, but if `Objects.equals` is used, `valueChanged` gets called twice. Let's keep the current behaviour, it's more reliable even though it looks inconsistent. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23436#discussion_r1953019780