B4J Question Pane bug ??

rdkartono

Member
Licensed User
Longtime User
I have 32 panes, that I created using designer.

At program, i want to add labels to each panes.

If I debug it, pressing F8 continuously, my codes can work normally (see "correct process by F8.png) , create expected result (see "correct screen.png")

But if I directly press RUN button on the same program, it will crash, saying can not cast label to pane.
(see "error when running.png").
Running in DEBUG mode, or RELEASE mode still make the same crash.

Attached are 3 pictures as proof.

Anybody knows ?
 

Attachments

  • correct process by F8.png
    correct process by F8.png
    72 KB · Views: 225
  • correct screen.png
    correct screen.png
    20.7 KB · Views: 238
  • error when running.png
    error when running.png
    95.6 KB · Views: 276

rdkartono

Member
Licensed User
Longtime User
I use B4J 4.20, and JDK 1.8 64 bit edition, on windows 10 64 edition.
I used B4J alot in my projects already... so I believe this is a bug...
 
Upvote 0

rdkartono

Member
Licensed User
Longtime User
@Erel, I will investigate some more..

In the mean time, from this section for adding a label to a pane, what possibly could be wrong ?
B4X:
Private Sub create_record_panel (pp As Pane,prefix As String)
    Dim ll As Label
    ll.Initialize("lbl")
    ll.Text = "CH "&prefix.SubString(1)
    pp.AddNode(ll,1dip,1dip,-1,-1)
    Log("panel "&prefix&" added")
End Sub

If you see at "correct process by F8.png", you can see logs "Panel R22 added" ... to.... "Panel R32 added", which is exactly as I wanted.
But if you see at "error when running.png", you can see log that "Panel R01 added" was a proof of succesful that above code was executed once.
Executing the next one, will make "label cannot be casted to pane" error exception.
This is something that i couldn't understand. I know the difference between label and pane.

If I make something like this :
B4X:
dim xx as label
xx.initialize("")
dim yy as pane = xx
then I understand that "label cannot be casted to pane" exception is happened.

But from my code, I want to add a label to a pane, by "pane.AddNode()" function, so .. definitely not casting label to pane, right ?

Enlightened me please.
 
Upvote 0

rdkartono

Member
Licensed User
Longtime User
I uploaded the program. If you have time, kindly check.
 

Attachments

  • Queing IP Monitor.zip
    32.6 KB · Views: 206
Upvote 0
Top