私は、JScrollPaneでJEditorPaneをラップした単純なSwingアプリケーションを持っています。JEditorPaneとJScrollPaneとアクセシビリティ
JAWSやNVDAなどのスクリーンリーダーソフトウェアは正しく動作しません。
フォーカスがJEditorPaneに入力されると、JEditorPaneの内容の読み取りを継続することが予想される場合にのみ、アクセス可能な名前とその後に続く「text」が読み込まれ、その後停止します。
JEditorPaneをJScrollPaneにラップしないと、期待通りに動作します。
Monkeyを使用してアクセス可能なツリーを検査しようとしましたが、JScrollPaneでラップされたJEditorPaneとラップされていないJeditorPaneの間に関連する違いはありません。
アイデア?
これは、問題を示す簡単なサンプルです。フォーカスが最初のJEditorPaneに入ると、JAWSは "first editorpane - edit"を読み込みます。フォーカスが2番目のJEditorPaneに入ると、JAWSは「2番目のeditorpane-edit-bar」を読み込みます。
public final class SmallExample {
public static void main(String... aArgs){
JFrame frame = new JFrame("Test Frame");
JPanel panel = new JPanel();
JEditorPane editorPane1 = new JEditorPane();
editorPane1.setText("Foo");
editorPane1.getAccessibleContext().setAccessibleName("first editorpane");
editorPane1.getAccessibleContext().setAccessibleDescription("");
JScrollPane scrollPane = new JScrollPane(editorPane1, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
panel.add(scrollPane);
JEditorPane editorPane2 = new JEditorPane();
panel.add(editorPane2);
editorPane2.setText("Bar");
editorPane2.getAccessibleContext().setAccessibleName("second editorpane");
editorPane2.getAccessibleContext().setAccessibleDescription("");
frame.getContentPane().add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}