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

Plugin applet focus traversal problem

XMLWordPrintable

    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"
      Java(TM) SE Runtime Environment (build 1.6.0-rc-b93)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b93, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Internet Explorer 6

      A DESCRIPTION OF THE PROBLEM :
      This is an accessibility issue: Users who are not able to use an mouse and rely on keyboard input need to access interactive elements by using the TAB-Key.

      On a webpage you can navigate using the TAB-key for html-elements but not always for applet gui elements.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Surf to http://www.axian.de/test/focus/TestApplet.html
      2) Testcase A: navigate through the webpage by using the TAB-Key only.
      3) Testcase B: Klick on the JTextField "Type Me" and navigate through the webpage by using the TAB-Key only.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected
      2) Testcase A: Every element on the webpage can be reached via TAB including the two applet elements: the button and the textfield.

      3) Testcase B: Every element on the webpage can be reached via TAB including the two applet elements: the button and the textfield.

      ACTUAL -
      Actual:

      2) Testcase A: The applet button "Push me" can't be accessed via TAB

      3) Testcase B: The applet button "Push me" can't be accessed via TAB


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Container;
      import java.awt.GridLayout;
      import java.awt.Window;

      import javax.swing.JApplet;
      import javax.swing.JButton;
      import javax.swing.JTextField;
      import javax.swing.LayoutFocusTraversalPolicy;

      public class TestApplet extends JApplet
      {
       JButton button;
       JTextField field;
       public void init()
       {
            
           // Set the focus traversal policy

            setFocusTraversalPolicy(new LayoutFocusTraversalPolicy());
      Container parent = this.getParent ();
      while (!(parent instanceof Window) && parent != null)
          {
      parent= parent.getParent ();
      }
      if (parent != null)
      {
      parent.setFocusTraversalPolicy (new javax.swing.LayoutFocusTraversalPolicy ());
         }
            
      button = new JButton("Push Me");
      field = new JTextField("Type Me");
      getContentPane().setLayout(new GridLayout(1,2));
      getContentPane().add(button);
      getContentPane().add(field);

       }
      }
      -----------------------------------------------------------------------------------
      <HTML>
      <HEAD>
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
      charset=windows-1252">
      <TITLE>
      Test Focus Applet
      </TITLE>
      </HEAD>
      <BODY>
      <form>
      First name:
      <input type="text" name="fname" value="Mickey" />
      <br />
      Last name:
      <input type="text" name="lname" value="Mouse" />
      <br />
      <input type="submit" value="Submit" />
      </form>
      Applet
      <comment> <applet code="TestApplet.class" codebase="." width="850"
      height="500"></applet> </comment>
      <form>
      Address:
      <input type="text" name="address" value="San Jose" />
      <br />
      <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="50%" height="50%" tabindex="1" name="cmpm-1"
      codebase="http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,0">
        <param name=CODE value="TestApplet.class" >
        <param name=NAME value="TestApplet" >
        <param name=CODEBASE value="./">
        <param name="type" value="application/x-java-applet;version=1.4">
        <param name="scriptable" value="false">
        <param name="IMG" value="img01.gif">
        <comment> <embed type="application/x-java-applet;version=1.4"
                                  code="TestApplet.class"
                                  name="TestApplet"
                                  codebase="./"
                                  width="100%" height="100%"
                                  img="img01.gif"
                                  scriptable=false
                                                                              
      pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html">
      <noembed> </noembed>
      </embed> </comment>
      </object>
      Country:
      <input type="text" name="country" value="USA" />
      <br />
      <input type="submit" value="California?" />
      </form>
      </BODY>
      </HTML>
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Workaround:

      The only way to access the applet button "Push me" with Shift-TAB.

      This is unsufficient and leads to inconsistent behavior:
      TAB order is
      ... -> "Submit" -> "Address" -> "Country" -> "California" -> "Browser URL" -> "Type Me" (!) -> "First name" -> ...
      Shift-Tab order is
      ... -> "First name" -> "Push me" (!) -> "Browser URL" -> "California" -> ...

            ccheung Calvin Cheung
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: