Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private tf1 As TextField
Private robot,temp As JavaObject
End Sub
Sub AppStart (Form1 As Form, Args() As String)
robot = temp.InitializeStatic("com.sun.glass.ui.Application").RunMethodJO("GetApplication",Null).RunMethodJO("createRobot",Null)
MainForm = Form1
MainForm.RootPane.LoadLayout("tf1") 'Load the layout file. just a textfield
MainForm.Show
End Sub
Sub tf1_TextChanged (Old As String, New As String)
If New.Length > 0 Then
If "0123456789".Contains(New.SubString2(New.Length-1,New.Length)) = False Then
robot.RunMethod("keyPress",Array As Object(8)) ' send backspace to field if alpha character
End If
End If
End Sub