in my code, there are several labels, several checkboxes, and several spinners.
Initialization codes are as below :
and events are like below :
The problem is when i compile it, show error as below :
B4J version: 5.50
Parsing code. (0.03s)
Compiling code. (0.15s)
Compiling layouts code. (0.23s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
B4J line: 168
If Not(Sender Is Spinner) Then Return
javac 1.8.0_65
src\b4j\example\transmittering.java:195: error: illegal start of type
if (__c.Not(__c.Sender(ba) instanceof <any>)) {
^
1 error
It seems that these lines
Is spinner in B4J can't use Sender ?
Why the others, like label and checkbox can use Sender ?
Initialization codes are as below :
B4X:
Dim tr As TXTableRow = TXTable.Get(ii)
Dim lbl_description As Label
lbl_description.Initialize("lbldescription")
lbl_description.Text = tr.Description
lbl_description.Tag = tr
Dim lbl_IP As Label
lbl_IP.Initialize("lblIP")
lbl_IP.Text = tr.IP
lbl_IP.Tag = tr
Dim lbl_enabled As CheckBox
lbl_enabled.Initialize("lblenabled")
lbl_enabled.Text = ""
lbl_enabled.Checked = tr.Enabled
lbl_enabled.Tag = tr
Dim lbl_volin As Spinner
lbl_volin.Initialize("lblvolin")
lbl_volin.SetNumericItems(0,15,1,tr.VolumeInput)
lbl_volin.Tag = tr
and events are like below :
B4X:
'IP address is about to change
Private Sub lblIP_MouseClicked (EventData As MouseEvent)
If EventData.ClickCount<2 Then Return
If Not(Sender Is Label) Then Return
Dim lbl As Label = Sender
If lbl.IsInitialized=False Then Return
Dim tr As TXTableRow = lbl.Tag
If tr.IsInitialized=False Then Return
End Sub
'enabled is about to change
Private Sub lblenabled_CheckedChange(Checked As Boolean)
If Not(Sender Is CheckBox) Then Return
Dim lbl As CheckBox = Sender
If lbl.IsInitialized=False Then Return
Dim tr As TXTableRow = lbl.Tag
If tr.IsInitialized=False Then Return
tr.Enabled = Checked
save_TXTable
End Sub
'volume input is about to change
Private Sub lblvolin_ValueChanged (Value As Object)
If Not(Sender Is Spinner) Then Return
Dim spn As Spinner = Sender
If spn.IsInitialized=False Then Return
Dim tr As TXTableRow = spn.Tag
If tr.IsInitialized=False Then Return
tr.VolumeInput = Value
save_TXTable
If Main.barixdevice.DeviceCollection.ContainsKey(tr.IP) Then
Main.barixdevice.ChangeVolumeInput(tr.IP,tr.VolumeInput)
End If
End Sub
The problem is when i compile it, show error as below :
B4J version: 5.50
Parsing code. (0.03s)
Compiling code. (0.15s)
Compiling layouts code. (0.23s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
B4J line: 168
If Not(Sender Is Spinner) Then Return
javac 1.8.0_65
src\b4j\example\transmittering.java:195: error: illegal start of type
if (__c.Not(__c.Sender(ba) instanceof <any>)) {
^
1 error
It seems that these lines
caused problem. If I comment all lines in spinner ValueChanged event, B4J can compile correctly.If Not(Sender Is Spinner) Then Return
Dim spn As Spinner = Sender
Is spinner in B4J can't use Sender ?
Why the others, like label and checkbox can use Sender ?