-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
None
-
x86
-
windows_2000
mouseMove method of Robot is not moving to right location on Windows2000.
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b81)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b81, mixed mode)
To reproduce :
1. Compile and execute the following code :
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TestGetScreenLoc extends JFrame{
JTextField tf;
Robot robo;
public static void main(String[] args) {
System.out.println("Hello World!");
new TestGetScreenLoc();
}
TestGetScreenLoc() {
super("TestGetScreenLoc");
setSize(200,200);
getContentPane().setLayout(new FlowLayout());
tf = new JTextField("Testing screen location.");
getContentPane().add(tf);
setVisible(true);
try {
robo = new Robot();
} catch (Exception e) {
System.out.println(e.toString());
}
Point pt = tf.getLocationOnScreen();
System.out.println("Location of JTextField is >> " + pt);
robo.mouseMove(pt.x, pt.y);
}
}
2. You will see that mouse doesn't move to respective location.
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b81)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b81, mixed mode)
To reproduce :
1. Compile and execute the following code :
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TestGetScreenLoc extends JFrame{
JTextField tf;
Robot robo;
public static void main(String[] args) {
System.out.println("Hello World!");
new TestGetScreenLoc();
}
TestGetScreenLoc() {
super("TestGetScreenLoc");
setSize(200,200);
getContentPane().setLayout(new FlowLayout());
tf = new JTextField("Testing screen location.");
getContentPane().add(tf);
setVisible(true);
try {
robo = new Robot();
} catch (Exception e) {
System.out.println(e.toString());
}
Point pt = tf.getLocationOnScreen();
System.out.println("Location of JTextField is >> " + pt);
robo.mouseMove(pt.x, pt.y);
}
}
2. You will see that mouse doesn't move to respective location.
- duplicates
-
JDK-4504963 JCK1.3a, interactive: Robot's mouseMove behaves incorrectly under Windows
- Closed