-
CSR
-
Resolution: Approved
-
P3
-
behavioral
-
low
-
No significant risk.
-
Java API
-
SE
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) ;
- csr of
-
JDK-8239137 JAWS does not always announce the value of JSliders in JColorChooser
- Resolved