Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Canvas1 As Canvas
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'Layout only holds Canvas1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
Dim CJO As JavaObject = Canvas1
Dim O As Object = CJO.CreateEventFromUI("javafx.event.EventHandler","CanvKeyPressed",Null)
CJO.RunMethod("setOnKeyPressed",Array(O))
CJO.RunMethod("setFocusTraversable",Array(True))
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub CanvKeyPressed_Event (MethodName As String, Args() As Object) As Object
Dim KEvt As JavaObject = Args(0)
Log(KEvt.RunMethod("getCode",Null))
End Sub