-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.3.0
-
generic
-
generic
Name: naC79102 Date: 11/30/99
java.awt.font.TextMeasurer's
deleteChar(AttributedCharacterIterator newParagraph, int deletePos) method
throws an ArrayIndexOutOfBoundsException for any value of deletePos.
import java.awt.font.TextMeasurer;
import java.text.AttributedString;
import java.awt.font.FontRenderContext;
import java.awt.geom.AffineTransform;
import java.text.AttributedCharacterIterator;
public class Test {
public Test() {
String string = "01234567890123456789";
AttributedCharacterIterator text = (new
AttributedString(string)).getIterator();
FontRenderContext frc = new FontRenderContext(new
AffineTransform(),true,true);
TextMeasurer measurer = new TextMeasurer(text, frc);
String newstring = "0123456789";
AttributedCharacterIterator newtext = (new
AttributedString(newstring)).getIterator();
try {
measurer.deleteChar(newtext,2);
System.out.println("Successfully deleted character");
}
catch(Exception e) {
System.out.println("deleteChar threw "+e);
}
}
public static void main(String[] args) {
new Test();
}
}
======================================================================