The OP want's to change the height at runtime, you would have to get the cell / row to change the styleclass for it to work. It would be nice if there were a simple way to do it.
' Set the height of a tableview row in px. Default is 24
' Ref: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TableView.html#setFixedCellSize-double-
' Example: SetTableViewRowHeight(TableView1, 48)
Sub SetTableViewRowHeight(tv As TableView, h As Double)
Dim joTV As JavaObject = tv
joTV.RunMethod("setFixedCellSize",Array(h))
End Sub
That's good, it sets the height of all rows to the same value. Looking at the original question again, that might be the answer. I read it as the OP was trying to set the size of one row.
Thank you guys for brainstroming!
Thanks rwblinn. Works great. Was to blind to find the right java-method.
To contribute also a little, maybe useful for others to easy customize a tableview, a summary of a lot:
B4X:
' assuming, there is a mytableview1 existing:
'Style it:
SetColumnStyle(mytableview1, 0, "-fx-text-fill: black; -fx-font-weight: bold; -fx-alignment: CENTER_LEFT;")
SetColumnStyle(mytableview1, 1, "-fx-text-fill: blue; -fx-font-weight: bold; -fx-alignment: CENTER_RIGHT;")
'Change row and text height (size in px):
mytableview1.Style="-fx-font-size: " & size & "px;"
SetTableViewRowHeight(mytableview1, size+6)
B4X:
Sub SetColumnStyle(tv As TableView, ColumnIndex As Int, Style As String, h as DOUBLE)
Dim jo As JavaObject = tv
jo.RunMethodJO("getColumns", Null).RunMethodJO("get", Array(ColumnIndex)).RunMethod("setStyle", Array(Style))
End Sub
Sub SetTableViewRowHeight(tv As TableView, h As Double)
Dim jo As JavaObject = tv
jo.RunMethod("setFixedCellSize",Array(h))
End Sub