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

TextComponent.AccessibleAWTTextComponent.getAfterIndex(...) works incorrectly.

XMLWordPrintable

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



      Name: aaC67449 Date: 07/23/99



      TextComponent.AccessibleAWTTextComponent.getAfterIndex(int part, int index)
      works incorrectly, when 'part' parameter is AccessibleText.WORD.
      It returns a space (" ") instead of the correct word.

      See example.
      ------------- example --------------
      import java.awt.*;
      import javax.accessibility.*;

      public class Test {

         public static void main(String argv[]) {

             TextField o=new TextField("Test1 test2.");
             AccessibleText c = o.getAccessibleContext().getAccessibleText();
             if (!c.getAfterIndex(AccessibleText.WORD,2).equals("test2")) {
                 System.out.println("Failed. Method returns:\""
                         +c.getAfterIndex(AccessibleText.WORD,2)+"\"");
             } else {
      System.out.println("Passed");
             }
         }

      }

      ------------- JDK1.3L output ---------------
      Warning: JIT compiler "sunwjit" not found. Will use interpreter.
      Failed. Method returns:" "

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

            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: