Hi to all
How I can get the row data in TableView clicking on it with mouse?
I would like to have the same result that you get with SelectedRowChanged.
This event (SelectedRowChanged) need for other purposes.
Yes, to capture the mouse click on a row you would have to Create a RowFactory and populate the table in a completely different way. You could also catch the mouseclick on the Tableview (anywhere on it) and calculate the row from the mouse click position. Or the simplest would be to record the click using an EventFilter which fires before the SelectedRowChanged sub, then when the SelectedRowChanged Event fires you will know if the mouse was pressed or not.
Private fx As JFX
Private MainForm As Form
Private TableView1 As TableView
Private MousePressed As Boolean
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
TableView1.SetColumns(Array As String("Col1","Col2"))
Dim L As List
For i = 0 To 10
L.Add(Array As String("C1-"&i,"C2-" & i))
Dim TVJO As JavaObject = TableView1
Dim MouseEvent As JavaObject
Dim O As Object = TVJO.CreateEventFromUI("javafx.event.EventHandler","TVPressed",Null)
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Private Sub TVPressed_Event (MethodName As String, Args() As Object) As Object
MousePressed = True
Sub TableView1_SelectedRowChanged(Index As Int, Row() As Object)
If MousePressed Then
MousePressed = False
Log("Selected Changed By Mouse Click")
Log("Selected Changed Other")