How to get Vista storyteller to read my Swing components to me?

I'm trying to run a very simple test of a very simple availability check for Swing, so I can get an idea of ​​how much work it will be to provide accessibility support for an already installed Swing application.

I have the simplest Swing program, and I'm using Narrator in Windows Vista to try and display its GUI.

public class ReadableFrame extends JFrame { private ReadableFrame() { super(); setTitle( "Banjollity Window" ); setSize( 640, 580 ); setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ); JButton button = new JButton( "Hello World" ); getContentPane().setLayout( new FlowLayout() ); getContentPane().add( button ); setVisible( true ); } /** * @param args */ public static void main( String[] args ) { new ReadableFrame(); } } 

The narrator can read the title, but nothing more. I get a "Banjollity window that does not contain other known controls." If I replaced Swing JButton with an AWT button as follows:

 Button button = new Button( "Hello World" ); 

... then it works correctly, and I get "Banjollity window, focus on the Hello World button, contains the Hello World button."

I tried installing the Java Access Bridge in JRE / lib / ext (and I strongly suspect that it works correctly, because my program refused to run my application until it put the DLL in Windows / System32), but to no avail.

Can someone help or share some suggestions?

+4
source share
4 answers

No, Narutor is a bad screen reader. You need to install the java access bridge, and then use jaws , which will run 40 minutes at a time as a demo, or NVDA , which is a free screen reader that also supports Java.

+4
source

As your conclusions with the button show, if the Storyteller is ready to read labels on native Windows applications, then you could possibly use heavy components, weight, so the OS becomes aware of them, and in turn, the Storyteller will read them.

0
source

This seems to be a problem with the narrator. If I use JAWS with my Java Access Bridge-enabled virtual machine, it reads every component perfectly on the screen.

0
source

Unfortunately, your swing components must implement the IAccessible interface, after which the narrator can detect the components and read their contents. Without this, there is no way to detect the controls.

0
source

Source: https://habr.com/ru/post/1286748/


All Articles