使用 JAWS 读取禁用的 JButton

发布于 2024-09-29 14:46:32 字数 368 浏览 9 评论 0原文

我要求 JAWS 版本 9 读取禁用的 JButton。即,如果我有一个带有文本“True”的 JButton,则应该读取类似“True,禁用按钮”的内容。但是当我使用 setEnabled(false) 时,它不再参与选项卡焦点序列,因此永远不会被读取。是否可以像我所描述的那样让 JAWS 读取禁用的 JButton?

我现在的“解决方案”是模拟禁用按钮并设置可访问名称,如下所示:

button.setForeground(Color.GRAY);
button.getAccessibleContext().setAccessibleName(buttonText + " disabled");

但我真的宁愿使用真正的禁用按钮。

I have a requirement that disabled JButton be read by JAWS version 9. i.e. if I have a JButton with the text "True", it ought to be read something like "True, disabled button". But when I use setEnabled(false) it no longer participates in the tab focus sequence, and therefore never gets read. Is it possible to make a disabled JButton readable by JAWS as I've described?

My "solution" right now is to emulate disabled buttons and set the accessible name as follows:

button.setForeground(Color.GRAY);
button.getAccessibleContext().setAccessibleName(buttonText + " disabled");

But I'd really rather use real disabled buttons.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一萌ing 2024-10-06 14:46:32

作为一个不得不与许多摆动界面作斗争的下巴用户,我不相信这是可能的,你应该坚持你的解决方案。另外值得注意的是,有传言称 Oracle 已经停止了 Java Access Bridge 的工作,因此新版本的 Java 将来可能无法与颌骨一起使用。但我找不到链接来确认或否认这一点。即使 Oracle 没有停止对 Access Bridge 的支持,在过去的几年里也没有开展任何有意义的工作。我认为不可能将 64 位 JVM 与 Jaws 和 Swing 一起使用,但我可能是错的。一般来说,Swing 和 Jaws 的可访问性相当差,除非您处于受控环境中,可以确保用户在未经事先测试的情况下不会升级到新版本的软件。虽然我知道如果将来要重写用户界面,那么重写是很重要的,但我会考虑从 Swing 迁移到 SWT。 SWT 与开箱即用的钳口配合良好,因为它在盖子下使用标准控件。我使用 Eclipse 作为一个相当易于访问的 IDE,并且我见过的所有 SWT 应用程序(除了 UML 编辑器)都可以通过 Jaws 轻松访问,无需自定义。

As a jaws user who's had to fight with many a swing interface I do not believe this is possible and you should stick with your solution. Also of note rumor has it that Oracle has stopped work on the Java Access Bridge so new versions of Java may not work with jaws in future. I can't find a link to confirm or deny this one way or the other though. Even if Oracle has not stopped support for the Access Bridge there has been no meaningful work on it for the passed several years. I don't think it's possible to use a 64 bit JVM with Jaws and Swing but I could be wrong. In general the accessibility of Swing and Jaws is quite poor unless your in a controlled environment where you can make sure users aren't upgrading to new versions of software with out prior testing. While I understand user interface rewrites are nontrivial if one is going to be done in the future I'd look at moving from Swing to SWT. SWT works well with jaws out of the box since it uses standard controls under the covers. I use Eclipse as a fairly accessible IDE and all SWT applications I've looked at with the exception of UML editors are fairly accessible with Jaws and no customization.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文