Skip to content

Needless state announcement on JMenu and JMenuItem (Java Access Bridge) #14336

Closed

Description

When opening a JMenu and selecting a JMenuItem (or a subclass of JMenuItem), NVDA announces the AccessibleState "selected" or "enabled". These state announcements are needless on menu and menu items and time-consuming when exploring menus.

Steps to reproduce:

Prerequisites:
You have installed a Java Runtime Environment, e.g. JDK/JRE version 17 or 18.
You have downloaded the SwingSet2 Demonstration Program from: https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html#swingset2

  1. Launch SwingSet2.jar with the Java JRE.
    The SwingSet2 application window appears.
  2. Open the File menu with keystroke Alt+F.
  3. Use arrow down key to navigate to the menu items About and Exit.

Actual behavior:

(I got a German speech output and translated it to English. Maybe the English speech output is different.)

File Menu selected enabled Alt+F
About selected B
Exit selected X

Expected behavior:

File Menu Alt+F
About B
Exit X

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

instlled

NVDA version:

Version 2022.3.1

Windows version:

Microsoft Windows 10 Enterprise
Version 10.0.19044 Build 1904

Name and version of other software in use when reproducing the issue:

java version "17.0.4" 2022-07-19 LTS
Java(TM) SE Runtime Environment (build 17.0.4+11-LTS-179)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.4+11-LTS-179, mixed mode, sharing)

Other information about your system:

Java Access Bridge is enabled.

Other questions

Does the issue still occur after restarting your computer?

Yes.

Have you tried any other versions of NVDA? If so, please report their behaviors.

Same behavior in previous versions of NVDA.

If NVDA add-ons are disabled, is your problem still occurring?

Not applicable.

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Not applicable.

Activity

  1. added
    triagedHas been triaged, issue is waiting for implementation.
    p4https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
    on Nov 8, 2022
  2. mwhapples commented on Nov 8, 2022

    @mwhapples
    Contributor

    I have mixed feelings over this issue. I understand where it comes from, other applications do not give the selected state for menus and so why should it be so for Java applications. However Java Access Bridge is supplying this state, it does signify something as menu items without the focus do not have the selected state and the item with selected state changes as you move around the menu. This use of the selected state can be observed when using object navigation in the menus rather than focus navigation. Thus it serves the purpose should someone be exploring the menu with object navigation to tell them which menu item has been selected/focused. Has a sufficient case been made for NVDA to have special handling to provide a non-accurate representation of the accessibility information been made here?

  3. mwhapples commented on Nov 8, 2022

    @mwhapples
    Contributor

    That would seem a reasonable solution to make it more user friendly whilst maintaining an accurate representation. The comparison with enabled/unavailable state though, it is not that simple. NVDA has a state unavailable but no state enabled (ie. the state is present for the exceptional case). For selection, NVDA has the state selected, I guess in many cases selected is the exception. So in the code mapping JAB objects to NVDA objects we are mapping correctly. However in some applications I have observed NVDA announce not-selected, so may be I can use that as a guide as to how to achieve this.

  4. mwhapples commented on Nov 8, 2022

    @mwhapples
    Contributor

    OK, the solution was simpler than I thought it would be. See the pull request to see if that does what you want.

  5. added a commit that references this issue on Nov 11, 2022
    0a97d20
  6. added this to the 2023.1 milestone on Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/java-access-bridgep4https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#prioritytriagedHas been triaged, issue is waiting for implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions