JDK-8239137 : JAWS does not always announce the value of JSliders in JColorChooser
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 7u4,8,11,13,14,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2020-02-17
  • Updated: 2021-08-03
  • Resolved: 2020-08-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 16 JDK 8
11.0.11-oracleFixed 16 b13Fixed 8u291Fixed
Related Reports
Blocks :  
CSR :  
JAWS and VO are not announcing the value of JSliders inside the JColorChooser always. They announce it first time always when the JSlider comes in focus. Afterwards, if the value is changed by Keyboard/mouse, JAWS and VO do not announce value always, but they do it sometimes randomly. The value should always be announced.
They announce the value correctly when the JSlider is used independently outside the JColorChooser.
It was backported to 11.0.11-oracle by mistake and the backport has been reverted/removed. Now this will not be backported because this involves interface changes (CSR).

Thank you! OpenJDK backport is on hold.

As of now I can not comment on that. What I have understood is that this issue will not be backported to jdk11 and jdk8 as we will have to backport CSR and that will be rejected. I will update the JBS if I get some further information on this issue.

JDK11u backport comment Was backportet to 11.0.11-oracle. Applies cleanly, but changes interface (CSR). CSR backport and JCK update is needed. We should wait until that is clarified.

[~pbansal] Thanks for the clarification. Will you look into other ways to do a fix in 11/8 or will you just not do it?

URL: https://hg.openjdk.java.net/jdk/jdk/rev/ee5be7357352 User: psadhukhan Date: 2020-08-22 04:56:29 +0000

URL: https://hg.openjdk.java.net/jdk/client/rev/ee5be7357352 User: pbansal Date: 2020-08-17 06:26:48 +0000

CSR approved

The VO part of the issue will be fixed by JDK-8079834. so, the current bug will deal with JAWS part only

According to the above observations on the Mac and discussion in meeting, the fix to https://bugs.openjdk.java.net/browse/JDK-8079834 should solve the current issue on Mac and if JDK-8079834 does not fix the current bug, fixing JDK-8079834 should be a pre-requisite to fix the current bug. So the current bug will focus only on Windows platform

On Mac, VO announces the value for first time and then there is a beep, and then VO stops announcing the Slider values. The issue seems to be related to JTabbedPane. VoiceOver draws a rectangle to show the component on screen which has its focus. If some widget is added a panel in JTabbedPane, I see that the VoiceOver focus is not moving to the component, even though keyboard focus is moved to it. It remains on the JTabbedPane. This should not happen and focus should move to the component which is in actual Keyboard focus. I have verified that if we don't use JTabbedPane in JColorChooser or create something similar without the JTabbedPane, the VO announce the values properly. Also, we add the JTabbedPane in accessibility ignoreRoles list, VO announces the values properly. Following patch makes the VO work with slider in JColorChooser diff -r 90e5e628aeda src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java Wed Jun 24 20:32:32 2020 -0700 +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java Tue Jun 30 22:55:51 2020 +0530 @@ -87,6 +87,7 @@ } else { ignoredRoles = new HashSet<String>(); } + ignoredRoles.add("pagetablist"); return sAccessibility; }

On windows, I see that if we maintain the order of sending the accessibility commands, then the slider values are being announced by JAWS. Following patch is working fine on Windows. diff -r 6628a50b6dcd src/java.desktop/share/classes/javax/swing/JSlider.java --- a/src/java.desktop/share/classes/javax/swing/JSlider.java Fri Jun 05 16:40:56 2020 -0700 +++ b/src/java.desktop/share/classes/javax/swing/JSlider.java Tue Jun 30 22:50:14 2020 +0530 @@ -534,13 +534,6 @@ return; } m.setValue(n); - - if (accessibleContext != null) { - accessibleContext.firePropertyChange( - AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, - Integer.valueOf(oldValue), - Integer.valueOf(m.getValue())); - } } @@ -1413,9 +1406,20 @@ */ @SuppressWarnings("serial") // Same-version serialization only protected class AccessibleJSlider extends AccessibleJComponent - implements AccessibleValue { + implements AccessibleValue, ChangeListener { + + + private int oldModelValue; /** + * AccessibleJSlider constructor + */ + protected AccessibleJSlider() { + // model is guaranteed to be non-null + oldModelValue = getModel().getValue(); + JSlider.this.addChangeListener(this); + } + /** * Get the state set of this object. * * @return an instance of AccessibleState containing the current state @@ -1437,6 +1441,24 @@ } /** + * Invoked when the target of the listener has changed its state. + * + * @param e a <code>ChangeEvent</code> object. Must not be null. + * @throws NullPointerException if the parameter is null. + */ + public void stateChanged(ChangeEvent e) { + if (e == null) { + throw new NullPointerException(); + } + int newModelValue = getModel().getValue(); + firePropertyChange( + AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, + Integer.valueOf(oldModelValue), + Integer.valueOf(newModelValue)); + oldModelValue = newModelValue; + } + + /** * Get the role of this object. * * @return an instance of AccessibleRole describing the role of the object

The issue here is that in case of JColorChooser, the JSlider and JSpinner are in sync always. This is done in SlidingSpinner class by changing the value of the other component when value of one component is changed. eg, if the slider value is changed, we will change the spinner value as well in the listener inside SlidingSpinner class. When this is done, it results in two events being sent to Accessibility, one each for JSlider and JSpinner value change. The event which is sent later is being ignored. This may be because these events are being sent very quickly. The changeListeners, in JSlider and JSpinner are written in a way that, whether the JSlider value is changed or JSpinner value is changed, the event for JSpinner is sent first to accessibility. When the JSpinner is used, the JSpinner event is sent first and JSlider event later, so this works fine. When JSlider value is changed, the JSpinner event is sent first again. This results in JSlider event being ignored. I think it should be possible to solve this by changing order of ChangeListeners in JSlider and JSpinner. But I have read that We can not really on the order of ChangeListeners order, as this can change later due to any other reason.