I use:
CheckboxGroup cg = new CheckboxGroup();
Checkbox c1 = new Checkbox("A", false, cg);
Checkbox c2 = new Checkbox("B", false, cg);
Checkbox c3 = new Checkbox("C", true, cg);
To create a group of three checkboxes. Now, I want to check which one of them is checked. I use:
if (c1.isSelected()) { }
but this gives The method isSelected() is undefined for the type Checkbox
... Recommended solution is add cast to c1, I do so and it gives Cannot cast from Checkbox to AbstractButton
... Again, how can I just check if a Checkbox if checked?
CheckboxGroup#getSelectedCheckbox()
? – Destalinization