title: Java FX looping through Anchor pane to get CheckBox name and if selected
body: <p>I have an Anchorpane which will have up to 20+ check boxes on it. I want to write a loop to get the name of each check box and if it is selected.</p>
  
  <p>I have this working code so far </p>
  
  <pre><code>import javafx.scene.layout.AnchorPane;
  
  @FXML
  private AnchorPane lootAnchorPane;
  
  ObservableList&lt;Node&gt; children = lootAnchorPane.getChildren();
              for (Node child : children) {
                  System.out.println(child.getId());
              }
  </code></pre>
  
  <p>This prints the id's well enough but I am not able to use <code>child.getText()</code> or <code>child.isSelected()</code>. As far as i understand the Checkbox classes are returned. I think it has something to do with the <code>@FXML</code> annotation. But im not sure how to implement this inside a for loop?</p>