title: Java check if Checkbox is checked
body: <p>I use:</p>
  
  <pre><code>    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);
  </code></pre>
  
  <p>To create a group of three checkboxes. Now, I want to check which one of them is checked. I use:</p>
  
  <pre><code>if (c1.isSelected()) { }
  </code></pre>
  
  <p>but this gives <code>The method isSelected() is undefined for the type Checkbox</code>... Recommended solution is add cast to c1, I do so and it gives <code>Cannot cast from Checkbox to AbstractButton</code>... Again, how can I just check if a Checkbox if checked?</p>