Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private tf As TextField
Private AutoCompletionBinding As JavaObject
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
MainForm.RootPane.LoadLayout("1")
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "test.css"))
SetAutoComplete(File.ReadList(File.DirAssets, "cities.txt"), tf)
End Sub
Sub IgnoreInputChanges (ignore As Boolean)
Dim r As Reflector
r.Target = AutoCompletionBinding
r.SetField("ignoreInputChanges", ignore, "java.lang.boolean")
End Sub
Sub SetAutoComplete(Items As List, Field As TextField)
Dim jo As JavaObject
jo.InitializeStatic("org.controlsfx.control.textfield.TextFields")
AutoCompletionBinding = jo.RunMethod("bindAutoCompletion", Array(Field, Items))
End Sub