ThRuST Well-Known Member Licensed User Longtime User Oct 25, 2017 #1 I am adding full screen detection to read the current mouse cursor position by using a timer which works but displays a warning message in the logs. Any assistance for a workaround is appreciated, thanks. Process globals Code: Copy Dim MousePositionTimer As Timer Dim temp,robot As JavaObject Dim x,y As Int Dim Lbl_PanelTopPosition As Label Appstart Code: Copy MousePositionTimer.Initialize("MousePositionTimer", 1) robot = temp.InitializeStatic("com.sun.glass.ui.Application").RunMethodJO("GetApplication",Null).RunMethodJO("createRobot",Null) MousePositionTimer.Enabled = True Code: Copy Sub MousePositionTimer_tick x = robot.RunMethod("getMouseX",Null) ' x position y = robot.RunMethod("getMouseY",Null) ' y position Lbl_PanelTopPosition.Text = x & " " & y End Sub Log: Waiting for debugger to connect... Program started. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by anywheresoftware.b4j.object.JavaObject (file:/C:/Dev/B4J/Libraries/JavaObject.jar) to method com.sun.glass.ui.Application.GetApplication() WARNING: Please consider reporting this to the maintainers of anywheresoftware.b4j.object.JavaObject WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Click to expand... I use Java jdk/rne v9.0.1.
I am adding full screen detection to read the current mouse cursor position by using a timer which works but displays a warning message in the logs. Any assistance for a workaround is appreciated, thanks. Process globals Code: Copy Dim MousePositionTimer As Timer Dim temp,robot As JavaObject Dim x,y As Int Dim Lbl_PanelTopPosition As Label Appstart Code: Copy MousePositionTimer.Initialize("MousePositionTimer", 1) robot = temp.InitializeStatic("com.sun.glass.ui.Application").RunMethodJO("GetApplication",Null).RunMethodJO("createRobot",Null) MousePositionTimer.Enabled = True Code: Copy Sub MousePositionTimer_tick x = robot.RunMethod("getMouseX",Null) ' x position y = robot.RunMethod("getMouseY",Null) ' y position Lbl_PanelTopPosition.Text = x & " " & y End Sub Log: Waiting for debugger to connect... Program started. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by anywheresoftware.b4j.object.JavaObject (file:/C:/Dev/B4J/Libraries/JavaObject.jar) to method com.sun.glass.ui.Application.GetApplication() WARNING: Please consider reporting this to the maintainers of anywheresoftware.b4j.object.JavaObject WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Click to expand... I use Java jdk/rne v9.0.1.
Erel B4X founder Staff member Licensed User Longtime User Oct 25, 2017 #2 You should ignore it. It is related to a change in Java 9 and the usage of refection (as done with JavaObject). Upvote 0
You should ignore it. It is related to a change in Java 9 and the usage of refection (as done with JavaObject).
ThRuST Well-Known Member Licensed User Longtime User Oct 25, 2017 #3 Thanks, that's good to know so we can all can still use this method. I'ld like to add that optional alternatives might be to use the jAWTRobot or the jNativeHook library which also is useful to track mouse events. Upvote 0
Thanks, that's good to know so we can all can still use this method. I'ld like to add that optional alternatives might be to use the jAWTRobot or the jNativeHook library which also is useful to track mouse events.
ThRuST Well-Known Member Licensed User Longtime User Oct 25, 2017 #4 Correction: I am not sure about if Nativehook supports MouseMove event even though it supports Mouseclicks and Keypress events. Upvote 0
Correction: I am not sure about if Nativehook supports MouseMove event even though it supports Mouseclicks and Keypress events.
Erel B4X founder Staff member Licensed User Longtime User Oct 26, 2017 #5 You don't need to use a different method because of these warnings. Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Oct 26, 2017 #6 @Erel Thanks, I decided in this case to go for a combo with your of course very useful solution and also Roycefers great libraries. That's why I mentioned them Upvote 0
@Erel Thanks, I decided in this case to go for a combo with your of course very useful solution and also Roycefers great libraries. That's why I mentioned them