Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8249806

The JTree "setRootVisible" method should be taken into account for screen reader

    XMLWordPrintable

Details

    Description

      A DESCRIPTION OF THE PROBLEM :
      Let's say I have a JFrame with a JTree inside and on the tree I have set "setRootVisible(false)" hiding the root element. Then I enable accessibility in the Java VM using "jabswitch -enable" and download and use the free NVDA screen reader.
      When I select a node in the tree, NVDA will read its name and it will also state its level. But because the root is not visible the level number read by NVDA should be decreased by one.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a JTree with a hidden root using "setRootVisible(false)". Use the NVDA narrator to read a selected item in the tree.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      NVDA should read the level of the selected item discarding the root as a level because the root is not visible.
      ACTUAL -
      NVDA should read the level of the selected item but takes the root into account as an initial level.

      ---------- BEGIN SOURCE ----------
        public static void main(String[] args) {
          JFrame frame = new JFrame("test");
          JTree tree = new JTree();
          tree.setRootVisible(false);
          frame.getContentPane().add(tree);
          frame.setSize(500, 500);
          frame.setVisible(true);
        }
      ---------- END SOURCE ----------

      FREQUENCY : always

      Attachments

        Activity

          People

            tongwan Andrew Wang
            tongwan Andrew Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: