简体   繁体   English

Java Swing JEditorPane 和屏幕阅读器

[英]Java Swing JEditorPane and Screen Readers

I've been looking for the last few days and can't find an answer anywhere.我最近几天一直在寻找,但在任何地方都找不到答案。 I'm trying to make an accessible IDE in Java Swing. The only thing I'm having problems with, is emulating behavior that happens in other text text editors.我正在尝试在 Java Swing 中创建一个可访问的 IDE。我唯一遇到的问题是模拟其他文本编辑器中发生的行为。

I want the screen reader (JAWS, in particular) to read whatever is in the selected line of the text area (not like highlighted, just wherever the cursor is - that whole line).我希望屏幕阅读器(尤其是 JAWS)阅读文本区域选定行中的任何内容(不像突出显示的那样,就在 cursor 所在的位置 - 整行)。

If I try this in Eclipse, or even notepad, whenever I use the arrow keys to move the text cursor, the screen reader immediately reads whatever is on that line.如果我在 Eclipse 或什至记事本中尝试此操作,每当我使用箭头键移动文本 cursor 时,屏幕阅读器会立即读取该行上的任何内容。 It does not do this in my program, which I've even tried to simplify down to a simple JFrame with a JEditorPane(tried a simple JTextArea as well).不会在我的程序中执行此操作,我什至尝试使用 JEditorPane(也尝试过简单的 JTextArea)将其简化为简单的 JFrame。

Is there a particular listener, or something I have to implement accessibility-wise, or idk what else, in order to create this functionality?是否有特定的侦听器,或者我必须实现可访问性方面的东西,或者 idk 其他什么,以便创建此功能? I apologize if my question is confusing.如果我的问题令人困惑,我深表歉意。 I'm still trying to learn how to actually make the accessibility stuff work.我仍在努力学习如何真正使辅助功能发挥作用。 If there's anything else I can clarify please let me know.如果还有什么我可以澄清的,请告诉我。

Have you looked into using the Java Access bridge (download and install it), as this is necessary for screen readers like JAWS to read java applications.您是否研究过使用 Java Access bridge(下载并安装它),因为这是 JAWS 等屏幕阅读器读取 java 应用程序所必需的。 Java access bridge info can be found here. Java 访问网桥信息可以在这里找到。 http://www.oracle.com/tec.network/java/javase/tech/index-jsp-136191.html http://www.oracle.com/tec.network/java/javase/tech/index-jsp-136191.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM