JDK-8251002 : JAWS does not always announce the value of JSliders in JColorChooser
  • Type: CSR
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 16
  • Submitted: 2020-08-04
  • Updated: 2020-08-14
  • Resolved: 2020-08-14
Related Reports
CSR :  
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) ;

Comments
Moving to Approved.
14-08-2020

I have made the asked changes in Specification section. I hope this is clearer now.
07-08-2020

Moving to Provisional, not Approved. Before the request is Finalized for the second phase of CSR review please have another client engineer review the request. Also, please more clearly indicate what exactly is changing. For example, AccessibleJSlider is not being added as a new class; it is an existing class being made to implement an additional interface and declare two more methods.
06-08-2020