title: MVC with JavaFX and FXML
body: <p>If I have a JavaFX project that uses FXML, how would I structure it to adhere to the Model-View-Controller pattern? This is what I would assume the general structure to be like:</p>
  
  <p>Model - Underlying program (what the GUI is representing).<br>
  View - FXML file.<br>
  Controller - FXML controller.</p>
  
  <p>The issue with this representation is that the view cannot be notified of the model's changes, as it is simply an FXML file. Should the view be the FXML controller class, and then should I have a main controller class such that the FXML controller gets information from the model, and the main controller handles the action events? In this case, how would the main controller access the JavaFX nodes?</p>
  
  <p>Also, in an MVC pattern, where should the main method be? Right now, It is in my JavaFX Application class, which then does nothing for the remainder of the program. Also, should the JavaFX Application class be part of the MVC pattern, or is it only necessary to initialize the GUI?</p>
  
  <p><strong>Summary of questions (please read the full post though):</strong></p>
  
  <ol>
  <li>How do I structure my JavaFX project which uses FXML to adhere to the MVC pattern? Should the view be the FXML controller class, and then should I have a main controller class such that the FXML controller gets information from the model, and the main controller handles the action events?</li>
  <li>In an MVC pattern, where should the main method be?</li>
  <li>Should the JavaFX Application class be part of the MVC pattern, or is it only necessary to initialize the GUI?</li>
  </ol>