Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251002

JAWS does not always announce the value of JSliders in JColorChooser

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 16
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      No significant risk.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Update the AccessibleJSlider class to implement the ChangeListener interface so that Assistive Technologies can better announce JSlider value changes.

      Problem

      The JAWS Assistive Technology (AT) for Windows is not announcing the values in the Swing JColorChooser component if the values are updated using its embedded JSlider component. In JColorChooser, a JSlider and JSpinner are both created for each Color component and they are kept in sync, by programmatically changing the value of one component when the other component value is changed by user action. For example, if the user changes the color component value using JSlider, the JSpinner value is also changed in JColorChooser. This results in two ACCESSIBLE_VALUE_PROPERTY events being sent to JAWS, one from each of JSlider and JSpinner. In the JSpinner class, the AccessibleJSpinner is already implementing ChangeListener interface, which enables an ACCESSIBLE_VALUE_PROPERTY property change event to be sent from the ChangeListener. But in JSlider it is done differently and the ACCESSIBLE_VALUE_PROPERTY property change event is being sent from the setValue() method in the JSlider class. This is causing issues as the ACCESSIBLE_VALUE_PROPERTY property change event for JSpinner is always being sent first and the JSlider event is not being processed by JAWS.

      Solution

      Update the AccessibleJSlider class to implement the ChangeListener interface. By doing this, the order of ACCESSIBLE_VALUE_PROPERTY change event being sent to JAWS is maintained.

      Specification

      The javax.swing.JSlider.AccessibleJSlider class is updated to implement the javax.swing.event.ChangeListener interface. An explicit no-args protected constructor is also added as it is needed to install the listener.

      protected class AccessibleJSlider extends AccessibleJComponent
      implements AccessibleValue, ChangeListener {
      
          /**
           * constructs an AccessibleJSlider
           */
          protected AccessibleJSlider();
      
          /**
           * Invoked when the target of the listener has changed its state.
           *
           * @param e  a {@code ChangeEvent} object. Must not be null.
           * @throws {@code NullPointerException} if the parameter is null.
           */
          public void stateChanged(ChangeEvent e) ;

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pbansal Pankaj Bansal
              Reporter:
              pbansal Pankaj Bansal
              Reviewed By:
              Philip Race, Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: