B4J Question TableView : what's this error ?

a n g l o

Member
Licensed User
hi,
start a new b4j project, add a TableView (designer), change the 'Sub Button1_Click' code :

B4X:
Sub Button1_Click
            Dim i As Int
            For i=1 To 105
                    If i Mod 2=0 Then
                                TableView1.SetColumns(Array As String("111","222"))
                                TableView1.SetColumnWidth(0,100)
                                TableView1.SetColumnWidth(1,100)
                    Else
                                TableView1.SetColumns(Array As String("RRR","MMM"))
                                TableView1.SetColumnWidth(0,200)
                                TableView1.SetColumnWidth(1,200)
                    End If               
                    TableView1.Items.Clear
                    Dim lbl101 As Label
                    lbl101.Initialize("")
                    lbl101.Text="abc"
                    Dim lbl102 As Label
                    lbl102.Initialize("")
                    lbl102.Text="xyz"
                    TableView1.Items.Add(Array As Object(lbl101,lbl102))
                    Sleep(100)
                    Log(i)
            Next
End Sub

run the program, click the button, watch the LOG.
the 1-105 loop is just to replace 105 button manuel clicks, each updating the table.
in my machine, after i=100, there's an error in the log. the Table Crashes (stops updating), until the end of the loop.
for the question what do i need such a code for : i don't. i have same error/case in a huge project i'm on, and this is just a code where i can make this error happens.

What's behind it ?

Thank you
 

John Naylor

Active Member
Licensed User
Longtime User
Just tried here and cannot replicate any error.

Could you post up the error you are getting?
 
Last edited:
Upvote 0

John Naylor

Active Member
Licensed User
Longtime User
GymReaper : i guess you're still with jdk 1.8. it's not happens there.
upgrade to jdk 11 and see the error on the log.
thanks you
Ahhh indeed. With jdk 11 I also see an error - Null pointer exception.

There seem to be a few mentions of similar happening from a few people on Git but no resolution. :(
 
Upvote 0
Top