'AppStart
Dim jo As JavaObject = TextArea1
Dim event As Object = jo.CreateEventFromUI("javafx.beans.value.ChangeListener", "SelectionChanged", Null)
jo.RunMethodJO("selectionProperty", Null).RunMethod("addListener", Array(event))
End Sub
Sub SelectionChanged_Event (MethodName As String, Args() As Object) As Object
If MethodName = "changed" Then
Dim IndexRange As JavaObject = Args(2)
Dim StartPosition As Int = IndexRange.RunMethod("getStart", Null)
Dim EndPosition As Int = IndexRange.RunMethod("getEnd", Null)
Log($"${StartPosition} -> ${EndPosition}"$)
End If
Return Null
End Sub