<Swing Dev> RFR: 8239137: JAWS does not always announce the value of JSliders in JColorChooser

Pankaj Bansal pankaj.b.bansal at oracle.com
Sun Jul 19 18:28:56 UTC 2020


Hi All,

Please review the following fix for jdk16.

Bug : https://bugs.openjdk.java.net/browse/JDK-8239137
webrev: http://cr.openjdk.java.net/~pbansal/8239137/webrev02/ 
<http://cr.openjdk.java.net/%7Epbansal/8239137/webrev02/>

Issue: The JAWS does not announce the value of JSlider in JColorChooser

Cause: The JSlider and JSpinner are kept in Sync in JColorChooser by 
changing the value of other component when one is used. eg, when we 
change color value using JSlider, the JSpinner value is also changed to 
keep the two in Sync. This results in two accessibility value change 
events being sent to JAWS (one for JSlider and JSpinner each) instead of 
just one for JSlider.

The event in JSlider is being sent from setValue method, whereas in case 
of JSpinner, the event is being sent from a AccessibleJSpinner 
stateChanged method which is added as changeListener to JSpinner. This 
results in situation where the event for JSpinner is always being sent 
first whether we are using JSlider or JSpinner. It looks like JAWS is 
not able to process all the events being sent quickly. So, the JSlider 
event is not being processed properly by JAWS.


Fix: The fix is to add the AccessibleJSlider as a ChangeListener on the 
JSlider and then sending the accesssiblity value change event from there 
instead of sending it from setValue method like being done in JSpinner. 
This results in the accessibility events being sent to JAWS in the order 
they are being changed. JAWS is able to announce the value properly for 
JSlider and JSpinner.

This can be tested by running any JColorchooser sample program (One such 
sample program is attached in JBS). I have run full jtreg and jck tests 
on mach5. The change is not breaking any test. Links in JBS.

Regards
Pankaj



More information about the swing-dev mailing list