[英]How to let NVDA read Swing / GUI elements
I am using the Eclipse ide for Java development.我正在使用 Eclipse ide 进行 Java 开发。 When I execute the following code, the NVDA only reads 'This is a frame'.
当我执行以下代码时,NVDA 只读取“这是一个框架”。 It doesn't read the button.
它不读取按钮。
import javax.swing.导入 javax.swing。 ;
; import javax.accessibility.
导入 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. **我已通过轻松访问中心启用了 AccessBridge。 I'm using Eclipse and NVDA on Windows 10.
我在 Windows 10 上使用 Eclipse 和 NVDA。
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
. jre\\lib\\accessibility.properties
包含类似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.请注意,Swing 和 access bridge 已经过时且已被弃用。 For newer projects, you should use another GUI library.
对于较新的项目,您应该使用另一个 GUI 库。 To make accessible GUI, you can for example use SWT instead.
要制作可访问的 GUI,您可以例如使用 SWT。
Due to a long list of issues, I ended up switching to Eclipse for Java EE.由于一长串问题,我最终切换到 Eclipse for Java EE。 I also updated my NVDA at around the same time.
我也大约在同一时间更新了我的 NVDA。 According to the What's New section of the update, they've done some improvements on Java AccessBridge.
根据更新的 What's New 部分,他们对 Java AccessBridge 做了一些改进。 I'm not sure if it was the NVDA update or switching to Java EE, but everything is working as it should.
我不确定是 NVDA 更新还是切换到 Java EE,但一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.