-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 21, 25, 26, 27
-
Component/s: client-libs
-
os_x
When VoiceOver is turned on: it identifies a JToggleButton as a "checkbox". The expected behavior is to identify it as a "toggle button".
I'm attaching a screenshot of "Font Book", where a toggle button is correctly read by VoiceOver. I'm assuming the main difference is the "Font Book" example uses a subrole of "AXToggle".
Here is sample code to reproduce the problem:
import javax.swing.*;
import java.awt.*;
/**
* Instructions:
* 1. Launch app
* 2. Turn on VoiceOver
* 3. Mouse over the last button
*
* VoiceOver should highlight the last button and call it a "toggle button".
* If it calls it a "checkbox" (or anything else) then this test fails
*/
public class ToggleButtonTest extends JFrame {
public static void main(String[] args) {
ToggleButtonTest t = new ToggleButtonTest();
t.pack();
t.setVisible(true);
}
public ToggleButtonTest() {
getContentPane().setLayout(new FlowLayout());
getContentPane().add(new JButton("JButton"));
getContentPane().add(new JRadioButton("JRadioButton"));
getContentPane().add(new JCheckBox("JCheckBox"));
getContentPane().add(new JToggleButton("JToggleButton"));
}
}
I'm attaching a screenshot of "Font Book", where a toggle button is correctly read by VoiceOver. I'm assuming the main difference is the "Font Book" example uses a subrole of "AXToggle".
Here is sample code to reproduce the problem:
import javax.swing.*;
import java.awt.*;
/**
* Instructions:
* 1. Launch app
* 2. Turn on VoiceOver
* 3. Mouse over the last button
*
* VoiceOver should highlight the last button and call it a "toggle button".
* If it calls it a "checkbox" (or anything else) then this test fails
*/
public class ToggleButtonTest extends JFrame {
public static void main(String[] args) {
ToggleButtonTest t = new ToggleButtonTest();
t.pack();
t.setVisible(true);
}
public ToggleButtonTest() {
getContentPane().setLayout(new FlowLayout());
getContentPane().add(new JButton("JButton"));
getContentPane().add(new JRadioButton("JRadioButton"));
getContentPane().add(new JCheckBox("JCheckBox"));
getContentPane().add(new JToggleButton("JToggleButton"));
}
}
- links to
-
Review(master)
openjdk/jdk/30096