-
Bug
-
Resolution: Cannot Reproduce
-
P2
-
None
-
1.3.0
-
sparc
-
solaris_2.6
If use click() of robot to click background ( no icon ), program hangs.
Try the test problem below.
import java.awt.*;
import sun.awt.*;
import sun.awt.robot.*;
import sun.awt.robot.probe.*;
//import java.awt.Robot.*;
//import com.sun.java.robot.probe.*;
public class RobotClickTest extends Frame {
Robot robot;
ProbeRobot probot;
Label l;
public RobotClickTest() {
super("RobotClickTest");
l=new Label("Testing the Click using robot on the desktop");
add("North",l);
Toolkit tk = Toolkit.getDefaultToolkit();
if (!(tk instanceof sun.awt.SunToolkit)) {
throw new RuntimeException("unexpected Toolkit type, must use SunToolkit");
}
SunToolkit stk = (SunToolkit)tk;
robot = stk.createRobot();
probot = new ProbeRobot(robot);
setBounds(10,300,350,200);
show();
}
public static void main(String args[]) {
RobotClickTest test=new RobotClickTest();
test.probot.pause(1000);
test.probot.glide(new Point(40,40),new Point(20,20));
test.probot.pause(1000);
test.probot.mouseMove(10,10);
test.probot.pause(1000);
test.probot.click();
test.probot.pause(1000);
test.dispose();
System.exit(0);
}
}
Try the test problem below.
import java.awt.*;
import sun.awt.*;
import sun.awt.robot.*;
import sun.awt.robot.probe.*;
//import java.awt.Robot.*;
//import com.sun.java.robot.probe.*;
public class RobotClickTest extends Frame {
Robot robot;
ProbeRobot probot;
Label l;
public RobotClickTest() {
super("RobotClickTest");
l=new Label("Testing the Click using robot on the desktop");
add("North",l);
Toolkit tk = Toolkit.getDefaultToolkit();
if (!(tk instanceof sun.awt.SunToolkit)) {
throw new RuntimeException("unexpected Toolkit type, must use SunToolkit");
}
SunToolkit stk = (SunToolkit)tk;
robot = stk.createRobot();
probot = new ProbeRobot(robot);
setBounds(10,300,350,200);
show();
}
public static void main(String args[]) {
RobotClickTest test=new RobotClickTest();
test.probot.pause(1000);
test.probot.glide(new Point(40,40),new Point(20,20));
test.probot.pause(1000);
test.probot.mouseMove(10,10);
test.probot.pause(1000);
test.probot.click();
test.probot.pause(1000);
test.dispose();
System.exit(0);
}
}