Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim b(10) As Button
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
For a = 0 To 9
b(a).Initialize("")
b(a).Id = ""&a
b(a).SetSize(10,10)
MainForm.RootPane.AddNode(b(a),a*12,0,-1,-1)
MouseOver(b(a))
Next
End Sub
Sub MouseOver(n As Object)
Dim n1 As Button = n
setHandler(n1,"setOnMouseEntered","mouseIn")
setHandler(n1,"setOnMouseExited","mouseOut")
End Sub
Sub setHandler(ob As JavaObject,eventName As String,handlerName As String)
ob.RunMethod(eventName, Array(ob.CreateEventFromUI("javafx.event.EventHandler",handlerName,True)))
End Sub
Sub mouseIn_Event(m As String,args() As Object)
Log("In "& asJO(Sender).RunMethod("getId",Null))
End Sub
Sub mouseOut_Event(m As String,args() As Object)
Log("Out "& asJO(Sender).RunMethod("getId",Null))
End Sub
Sub asJO(o As JavaObject) As JavaObject
Return o
End Sub