<AWT Dev> <Swing Dev>  JDK-7124285: Nothing heard from VoiceOver regarding the status of the progress bar
shashidhara.veerabhadraiah at oracle.com
Thu Oct 25 05:31:49 UTC 2018
Hi Sergey, While fixing this bug I did not verified the behavior of other components and how they behave with respect to the AT. Since the question about other components came up and did some debugging on that part. Below is the reason that I could find:
It is all about the focus traversal policy that is used for each component type. While the both the JProgressBar and JLabel derived from JComponent and then JComponent is also derived from Container and Component class. JProgressBar component goes via the DefaultFocusTraversalPolicy(.java) while the JLabel goes via the ContainerOrderFocusTraversalPolicy(.java) where there are overriding methods of accept() function. This builds different behavior for JLabel and JProressBar while focus traversal.
Since the both the components are derived out of Component class both are default to focusable to true(Component.java) but because of the way accept() method is overridden, JProgressBar's focusable state is considered only when the focus traversable is overridden(not FOCUS_TRAVERSABLE_DEFAULT). Now by calling setFocusable() explicitly overrides the current policy to FOCUS_TRAVERSABLE_SET, hence the focusable state of the JProgressBar is considered afterwards.
Hope this answers. Please let me know if you have any questions.
Thanks and regards,
From: Sergey Bylokhov
Sent: Thursday, October 25, 2018 3:11 AM
To: Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah at oracle.com>; awt-dev at openjdk.java.net; swing-dev at openjdk.java.net
Subject: Re: <Swing Dev>  JDK-7124285: Nothing heard from VoiceOver regarding the status of the progress bar
Can you please provide more information about relation of focusable state and a VoiceOver? The simple JLabel is not focusable, but VoiceOver reads its contents, and it is possible to select the label using VoiceOver's shortcuts.
On 22/10/2018 00:36, shashidhara.veerabhadraiah at oracle.com wrote:
> Hi All, Please review a swingset fix for the below bug.
> Bug: https://bugs.openjdk.java.net/browse/JDK-7124285
> Fix: http://cr.openjdk.java.net/~sveerabhadra/7124285/webrev.00/
> Problem: The JProgressBar component used in the swingset demo was not focusable and once it is turned on, now the progress status is getting narrated via the voice over.
> Thanks and regards,
Best regards, Sergey.
More information about the awt-dev