title: Create FileChooser in FXML
body: <p>I'm trying to create a fileChooser within an fxml file. My code looks like this: </p>
  
  <pre><code>&lt;HBox alignment="CENTER"&gt;
              &lt;Label text="Tower 1 Image" /&gt;
              &lt;TextField fx:id="tower1ImageField" /&gt;
              &lt;FileChooser fx:id ="tower1FileChooser" /&gt; 
  &lt;/HBox&gt;
  </code></pre>
  
  <p>And the controller reads like this: </p>
  
  <pre><code>public class HudBuilderController{
      @FXML TextField tower1ImageField;
      @FXML FileChooser tower1FileChooser;
      File towerFile; 
      @FXML TextField tower2ImageField;
      @FXML FileChooser tower2FileChooser;
  }
  </code></pre>
  
  <p>However, I'm getting an error that I don't understand: </p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Unable to coerce javafx.stage.FileChooser@5e85f35 to class javafx.scene.Node.
      at com.sun.javafx.fxml.BeanAdapter.coerce(Unknown Source)
      at javafx.fxml.FXMLLoader$Element.add(Unknown Source)
      at javafx.fxml.FXMLLoader$ValueElement.processEndElement(Unknown Source)
      at javafx.fxml.FXMLLoader.processEndElement(Unknown Source)
      ... 26 more
  </code></pre>
  
  <p>I've tried instantiating the FileChooser within the controller but I think I need to add more to the fxml file. Any help? Thanks!</p>