Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
Dim jo As JavaObject = ListSelectionView1
Dim event As Object = jo.CreateEventFromUI("javafx.collections.ListChangeListener", "ListChange", Null)
jo.RunMethodJO("getSourceItems", Null).RunMethod("addListener", Array(event))
End Sub
Sub ListChange_Event (MethodName As String, Args() As Object) As Object
If MethodName = "onChanged" Then
Dim Change As JavaObject = Args(0)
If Change.RunMethod("next", Null) = True Then
Dim MovedFromSourceToTarget As List = Change.RunMethod("getRemoved", Null)
Dim MovedFromTargetToSource As List = Change.RunMethod("getAddedSubList", Null)
For Each s As String In MovedFromSourceToTarget
Log("Moved to target: " & s)
Next
For Each s As String In MovedFromTargetToSource
Log("Moved to source: " & s)
Next
End If
End If
Return Null
End Sub