Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private TableView1 As TableView
Private MousePressed As Boolean
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
TableView1.SetColumns(Array As String("Col1","Col2"))
Dim L As List
L.Initialize
For i = 0 To 10
L.Add(Array As String("C1-"&i,"C2-" & i))
Next
TableView1.Items.AddAll(L)
Dim TVJO As JavaObject = TableView1
Dim MouseEvent As JavaObject
MouseEvent.InitializeStatic("javafx.scene.input.MouseEvent")
Dim O As Object = TVJO.CreateEventFromUI("javafx.event.EventHandler","TVPressed",Null)
TVJO.RunMethod("addEventFilter",Array(MouseEvent.GetField("MOUSE_PRESSED"),O))
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 TVPressed_Event (MethodName As String, Args() As Object) As Object
MousePressed = True
End Sub
Sub TableView1_SelectedRowChanged(Index As Int, Row() As Object)
Log(Row)
If MousePressed Then
MousePressed = False
Log("Selected Changed By Mouse Click")
Else
Log("Selected Changed Other")
End If
End Sub