2
看起来像com.sun.glass.ui.Robot在Javafx 2.2中无法工作。Javafx Robot无法从Javafx 2.2工作
有没有其他的选择?
我已经转移到AWT机器人,但这似乎并不是最好的解决方案。
看起来像com.sun.glass.ui.Robot在Javafx 2.2中无法工作。Javafx Robot无法从Javafx 2.2工作
有没有其他的选择?
我已经转移到AWT机器人,但这似乎并不是最好的解决方案。
玻璃(FX)机器人为我工作在2.2。尝试下:
public void start(Stage stage) {
Button btn = new Button();
btn.setText("Button");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Hello World!");
}
});
Scene scene = new Scene(new Group(btn), 300, 250);
stage.setTitle(VersionInfo.getRuntimeVersion());
stage.setScene(scene);
stage.setX(100);
stage.setY(100);
stage.show();
Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot();
robot.mouseMove(130, 130);
robot.mousePress(1);
robot.mouseRelease(1);
}
如果你想公开API为它加入你可以投票给下一个问题:http://javafx-jira.kenai.com/browse/RT-17571
谢谢谢尔盖,我已经投了吉拉的功能 – betaman 2012-08-14 13:20:03