Public Sub ExecuteTableView2(SQL As SQL, Query As String, StringArgs() As String, Limit As Int, _
TableView1 As TableView, alignments() As String)
' TableView1.Items.Clear
Dim cur As ResultSet
If StringArgs = Null Then
Dim StringArgs(0) As String
End If
cur = SQL.ExecQuery2(Query, StringArgs)
Dim cols As List
cols.Initialize
For i = 0 To cur.ColumnCount - 1
cols.Add(cur.GetColumnName(i))
Next
TableView1.SetColumns(cols)
Do While cur.NextRow
Dim values(cur.ColumnCount) As Object
For col = 0 To cur.ColumnCount - 1
Dim Clabel As Label
Clabel.Initialize("")
Clabel.Text = cur.GetString2(col)
values(col) = WrapView(Clabel,alignments(col))
Next
TableView1.Items.Add(values)
If Limit > 0 And TableView1.Items.Size >= Limit Then Exit
Loop
cur.Close
End Sub
Public Sub WrapView(lbl As Object, Alignment As String) As Pane
Dim pn1 As AnchorPane
pn1.Initialize("")
pn1.AddNode(lbl, 0, 0, -1, -1)
pn1.FillHorizontally(lbl, 0, 0)
Dim jo1 = lbl As JavaObject
jo1.RunMethod("setAlignment", Array As Object(Alignment))
Return pn1
End Sub