-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
1.3.0
-
sparc
-
solaris_2.6
Name: aaR10142 Date: 09/15/2000
The tweety JCK test
api\javax_swing\text\JTextComponent\AccessibleJTextComponent
failed on Windows NT4 with dual Processor.
The minimized test case is provided below.
These tests work correctly on Solaris dual Processor, and on NT with single
proccessor.
The test gets accessible context, call AccessibleText.getCharecterBounds(),
and verifies return value, by using JTextComponent.viewToModel()
So one of these methods returns incorrect value, when called for the second
text component.
------------------------- Test.java ----------------
import javax.accessibility.*;
import javax.swing.*;
import java.awt.*;
import javax.swing.text.*;
import javax.swing.event.*;
public class Test{
/* standalone interface */
public static void main(String argv[]) {
for (int k = 0; k <2 ; k++) {
JTextComponent o = new JTextField();
o.setText("Test1,Test2,Test3,Test4,Test5");
JFrame f = new JFrame();
f.getContentPane().add(o);
f.setSize(100, 100);
f.setVisible(true);
// wait till frame became really visible
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run(){}
});
} catch (InterruptedException e) {
} catch (java.lang.reflect.InvocationTargetException it) {
}
AccessibleText c = o.getAccessibleContext().getAccessibleText();
for (int j = 0; j < 10; j++) {
Rectangle rect = null;
rect = c.getCharacterBounds(j);
int result = o.viewToModel(new Point (rect.x, rect.y));
if (result!=j) {
System.out.println(" getCharacterBounds returns "+rect
+ "\n For cahracter #" + j
+ "\n viewToModel returns "+ result
+ "\n in " + k + " frame");
}
}
}
System.out.println("Finished");
}
}
------------------------- jdk1.3 NT4 dual Processor output ----------------
getCharacterBounds returns java.awt.Rectangle[x=2,y=28,width=8,height=17]
For cahracter #1
viewToModel return 0
in 1 frame
======================================================================