Hello (it's me again),
This makes my hair to disappear....
Obviously there is something that I miss here but I seems to be lost.
Based on the following thread:
https://www.b4x.com/android/forum/threads/tableview-content-resize.70348/
I Add / Delete / Update data (using a SQLite DB) in a TableView and after these operations I want to resize the columns so they fit to their contents.
This is the main sub:
In the subs I make the following calls with the assumption of a zero-based columns count:
When executing I get the following error message:
(NullPointerException) java.lang.NullPointerException
Please help me out.
TIA,
Dennis
This makes my hair to disappear....
Obviously there is something that I miss here but I seems to be lost.
Based on the following thread:
https://www.b4x.com/android/forum/threads/tableview-content-resize.70348/
I Add / Delete / Update data (using a SQLite DB) in a TableView and after these operations I want to resize the columns so they fit to their contents.
This is the main sub:
B4X:
Sub ResizeToFit(tv As TableView, ColumnIndex As Int)
Dim tvjo As JavaObject = tv
Dim r As Reflector
r.Target = tvjo.RunMethod("getSkin", Null)
r.RunMethod4("resizeColumnToFitContent", Array(tvjo.RunMethodJO("getColumns", Null).RunMethod("get", Array(ColumnIndex)), -1), _
Array As String("javafx.scene.control.TableColumn", "java.lang.int"))
End Sub
In the subs I make the following calls with the assumption of a zero-based columns count:
B4X:
...
Dim iCounter As Int
For iCounter = 0 To tvSoftware.ColumnsCount -1
ResizeToFit(tvSoftware, iCounter)
Next
...
When executing I get the following error message:
(NullPointerException) java.lang.NullPointerException
Please help me out.
TIA,
Dennis