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

JTextComponent.AccessibleJTextComponent.getBeforeIndex(...) works incorrectly.

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: aaC67449 Date: 08/31/98



      JTextComponent.AccessibleJTextComponent.getBeforeIndex(int part, int index) works incorrectly, when part parameter is AccessibleText.WORD.
      It returns a space (" ") instead of 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.getBeforeIndex(AccessibleText.WORD,7).equals("Test1"))
      System.out.println("Failed. Method returns:\""+c.getBeforeIndex(AccessibleText.WORD,7)+"\"");
                  else
      System.out.println("Passed");

         }

      }

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





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

            svioletsunw Scott Violet (Inactive)
            aalievsunw Artem Aliev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: