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

AccessibleAWTMenuComponent.getAccessibleIndexInParent() always returns -1.

XMLWordPrintable

    • b28
    • generic, sparc
    • generic, solaris_2.5.1
    • Verified



      Name: aaC67449 Date: 07/23/99



      The Menu.Component. AccessibleAWTMenuComponent.getAccessibleIndexInParent()
      always returns -1, but should return "the index of this object in its parent".

      javadoc says:"
      public int getAccessibleIndexInParent()

            Get the index of this object in its accessible parent.
            Overrides:
                  getAccessibleIndexInParent in class AccessibleContext
            Returns:
                  the index of this object in its parent; -1 if this object does not have an
                  accessible parent.
            See Also:
                  getAccessibleParent()
      "

      See example.
      ------------- example --------------
      import java.awt.Menu;
      import java.awt.MenuItem;
      import javax.accessibility.AccessibleContext;

      public class Test {
          public static void main(String argv[]) {
              MenuItem o = new MenuItem();
              AccessibleContext c = o.getAccessibleContext();

              Menu parent = new Menu();
              parent.add(new MenuItem());
              parent.add(o);

              System.out.println("index="+c.getAccessibleIndexInParent());
          }

      }
      ------------- JDK1.3L output ---------------
      Warning: JIT compiler "sunwjit" not found. Will use interpreter.
      index=-1

      ======================================================================

            prssunw Prs Prs (Inactive)
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: