Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim temp,robot As JavaObject
Dim t As Timer
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("robot") 'Load the layout file.
MainForm.Show
initRobot
t.Initialize("t",300)
t.Enabled = True
End Sub
Sub t_tick
Dim x,y As Int
x = robot.RunMethod("getMouseX",Null) ' screen co-ordinate not the forms
y = robot.RunMethod("getMouseY",Null) ' as x
MainForm.Title = "Mouse X:" & x & " Y:" & y
End Sub
Sub initRobot
robot = temp.InitializeStatic("com.sun.glass.ui.Application").RunMethodJO("GetApplication",Null).RunMethodJO("createRobot",Null)
End Sub