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

JTextComponent.AccessibleJTextComponent.getAfterIndex(...) works incorrectly.

XMLWordPrintable

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

      Name: aaC67449 Date: 08/31/98



      JTextComponent.AccessibleJTextComponent.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 com.sun.java.swing.*;
      import com.sun.java.accessibility.*;
      public class Test {

         public static void main(String argv[]) {

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

         }

      }


      ----------- output ----------------
      Enabling platform fonts
      Failed. Method returns:" "





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

            lmonsantsunw Lynn Monsanto (Inactive)
            aalievsunw Artem Aliev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: