VoiceOver Doesn't Correctly Identify JToggleButtons as "toggle buttons"

XMLWordPrintable

      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"));
          }
      }

            Assignee:
            Jeremy Wood
            Reporter:
            Jeremy Wood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: