On Fri, 27 Mar 2026 17:06:57 GMT, Phil Race <[email protected]> wrote:
> Why is this not a problem for all sorts of actions ?
> It seems wrong that we can't get the unlocalized action to use, why is this
> happening ?
I don't have a good answer. But here's some context.
The `getAccesibleActionDescription()` method behaves as follows for JComponents:
1. AbstractButton, JComboBox and JList return exactly one localized String.
2. JSlider and JSpinner return one of two unlocalized constants:
AccessibleAction.INCREMENT and AccessibleAction.DECREMENT
4. JTree may return AccessibleAction.TOGGLE_EXPAND, or pass the request along
to the tree node.
And these are unique:
4. JEditorPane uses the text in the Document itself
5. JTextComponent exposes all of the Action names in
JTextComponent.this.getActions()
The javadoc here reads:
/**
* Returns a description of the specified action of the object.
*
* @param i zero-based index of the actions
* @return a {@code String} description of the action
* @see #getAccessibleActionCount
*/
public String getAccessibleActionDescription(int i);
We have specific constants available in AccessibleAction: TOGGLE_EXPAND,
INCREMENT, DECREMENT, CLICK . But aside from the usages listed above: I don't
think they're referenced in the codebase.
For JButtons: I confirmed NVDA speaks the exact value of
`getAccessibleActionDescription` to the user.
VoiceOver doesn't speak `getAccessibleActionDescription`. The crux of this bug
is that we were treating the description `"click"` one way, and treating
translations of `"click"` differently.
(But again: I think this was largely unnoticed or forgivable, because VoiceOver
could use simulated mouse activity to activate the button via MouseEvents. So
users still generally got their desired result.)
So I agree something here seems wrong-ish. But at this point we're pretty
locked into this design, and IMO we would need a much more compelling ticket to
want to update AccessibleAction.
What do you think?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/30181#issuecomment-4152579364