I am using the Eclipse ide for Java development. When I execute the following code, the NVDA only reads ‘This is a frame’. It doesn’t read the button.
import javax.swing.; import javax.accessibility.;
public class MyButton {
public static void main(String [] args) {
JFrame f = new JFrame ("This is a frame");
JButton b = new JButton ("This one is a button");
b.setBounds(50,100,95,30);
//f.add(b);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
b.setToolTipText("This tooltip makes the button accessible");;
}
}
**I have enabled AccessBridge via Ease of Access Center. I’m using Eclipse and NVDA on Windows 10.
Normally, it should work. You can try the following things:
jre\lib\accessibility.properties
contains a line like assistive_technologies=com.sun.java.accessibility.AccessBridge
. I don't know if something similar still exists for Java 11+.Note that Swing and access bridge are old and kind of deprecated. For newer projects, you should use another GUI library. To make accessible GUI, you can for example use SWT instead.