Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private ComboBox1 As ComboBox
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
CallSubDelayed(Me,"SetupListeners")
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
Private Sub SetupListeners
Dim CBJO As JavaObject = ComboBox1
Dim TI As JavaObject = CBJO.RunMethod("lookup",Array(".text-input"))
If TI.IsInitialized Then
Dim TProp As JavaObject = TI.RunMethod("textProperty",Null)
Dim O As Object = TProp.CreateEventFromUI("javafx.beans.value.ChangeListener","CBTextChanged",Null)
TProp.RunMethod("addListener",Array(O))
Else
Log("EditText Not found or ComboBox is not editable")
End If
End Sub
Private Sub CBTextChanged_Event (MethodName As String, Args() As Object)
Dim Old As String = Args(1)
Dim New As String = Args(2)
Log("Old " & Old)
Log("New " & New)
End Sub