I have something very similar working in B4A but this simple project in B4J shows my problem.
I must be missing something in the declaration and the click event for the checkboxes is not triggered.
I have attached a complete project cut to the bone.
I must be missing something in the declaration and the click event for the checkboxes is not triggered.
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 200
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private cb(), CheckBox1, CheckBox2, CheckBox3, CheckBox4 As CheckBox
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("main") 'Load the layout file.
MainForm.Show
cb = Array As CheckBox( CheckBox1, CheckBox2, CheckBox3, CheckBox4)
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub cb_Click
Dim i As Int
Dim c As CheckBox
c = Sender
For i=0 To cb.Length-1
cb(i).checked = False
Next
cb(c.Tag).Checked = True
End Sub
I have attached a complete project cut to the bone.