petr4ppc Well-Known Member Licensed User Longtime User May 31, 2019 #1 Dear friend, please for advice, what I am doing wrong? I want move MouseCursor to X and Y Code: Copy Dim robot As JavaObject robot.InitializeNewInstance("javafx.scene.robot.Robot", Null) Dim Point2D As JavaObject Point2D.InitializeStatic("javafx.scene.input.mouseMove") robot.RunMethod("mouseMove", Array As Object(x, y)) I get in log: java.lang.RuntimeException: Method: mouseMove not matched. Click to expand... Thank you very much best regards p4ppc
Dear friend, please for advice, what I am doing wrong? I want move MouseCursor to X and Y Code: Copy Dim robot As JavaObject robot.InitializeNewInstance("javafx.scene.robot.Robot", Null) Dim Point2D As JavaObject Point2D.InitializeStatic("javafx.scene.input.mouseMove") robot.RunMethod("mouseMove", Array As Object(x, y)) I get in log: java.lang.RuntimeException: Method: mouseMove not matched. Click to expand... Thank you very much best regards p4ppc
petr4ppc Well-Known Member Licensed User Longtime User May 31, 2019 #3 Agraham, thank you for your answer In older Java I have define x,y as: Code: Copy oldx = robot.RunMethod("getMouseX",Null) oldy = robot.RunMethod("getMouseY",Null) x=oldx+10 y=oldy+10 (this is bad fo Java 11, I know it now) and I want add this function for Java 11: Code: Copy Dim robot As JavaObject robot.InitializeNewInstance("javafx.scene.robot.Robot", Null) Dim Point2D As JavaObject Point2D.InitializeStatic("javafx.scene.input.mouseMove") robot.RunMethod("mouseMove", Array As Object(x, y)) (this not functioned) Thank you very much, Best regards p4ppc Upvote 0
Agraham, thank you for your answer In older Java I have define x,y as: Code: Copy oldx = robot.RunMethod("getMouseX",Null) oldy = robot.RunMethod("getMouseY",Null) x=oldx+10 y=oldy+10 (this is bad fo Java 11, I know it now) and I want add this function for Java 11: Code: Copy Dim robot As JavaObject robot.InitializeNewInstance("javafx.scene.robot.Robot", Null) Dim Point2D As JavaObject Point2D.InitializeStatic("javafx.scene.input.mouseMove") robot.RunMethod("mouseMove", Array As Object(x, y)) (this not functioned) Thank you very much, Best regards p4ppc
agraham Expert Licensed User Longtime User May 31, 2019 #4 I've just looked inside the JavaObject code and realized that the "not matched" error is not coming, as I thought, from Robot but is in fact being raised by JavaObject itself That explains my mistaken suggestion for your mousePress error earlier on! The reason for the error is that the types being passed in the Array are not those required by the method. I guess that x and y are not declared as Doubles which is what mouseMove requires. Upvote 0
I've just looked inside the JavaObject code and realized that the "not matched" error is not coming, as I thought, from Robot but is in fact being raised by JavaObject itself That explains my mistaken suggestion for your mousePress error earlier on! The reason for the error is that the types being passed in the Array are not those required by the method. I guess that x and y are not declared as Doubles which is what mouseMove requires.
agraham Expert Licensed User Longtime User May 31, 2019 #5 You haven't answered the question. What are x and y declared as, that is how do you Dim them? Upvote 0
petr4ppc Well-Known Member Licensed User Longtime User May 31, 2019 #6 Excuse my not complete answer Agraham, I have Code: Copy Dim x as Int Dim oldx as Int Upvote 0
petr4ppc Well-Known Member Licensed User Longtime User May 31, 2019 #7 Yes you have right AGRAHAM, the trouble was in Dim x as int Click to expand... it must be Code: Copy Dim x as double Thank you very much. Best regards p4ppc Upvote 0
Yes you have right AGRAHAM, the trouble was in Dim x as int Click to expand... it must be Code: Copy Dim x as double Thank you very much. Best regards p4ppc