-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
kestrel
-
sparc
-
solaris_2.5.1
-
Not verified
Name: aaC67449 Date: 10/22/99
JTextComponent.getCharacterBounds() method throws unexpected NPE.
javadoc says:"
public Rectangle getCharacterBounds(int i)
Determines the bounding box of the character at the given index into the
string. The bounds are returned in local coordinates. If the index is
invalid a null rectangle is returned.
Specified by:
getCharacterBounds in interface AccessibleText
Parameters:
i - the index into the String >= 0
Returns:
the screen coordinates of the character's bounding box
"
This bug appears in JDK1.3.0-K. All works correctly in JDK1.3.0-J
See example.
------------- example --------------
import javax.swing.JTextField;
import javax.accessibility.AccessibleText;
public class Test {
public static void main(String argv[]) {
String test = "??!+++++";
JTextField o = new JTextField("Test");
AccessibleText c = o.getAccessibleContext().getAccessibleText();
c.getCharacterBounds(1);
System.out.println("Passed");
}
}
----------------JDK1.3.0-K--------------
Exception in thread "main" java.lang.NullPointerException
at javax.swing.text.JTextComponent$AccessibleJTextComponent.getCharacterBounds(JTextComponent.java:2044)
at Test.main(Test.java:11)
----------------JDK1.3.0-J--------------
Passed
======================================================================