title: SceneBuilder 2: Do controller classes need to necessarily be in the same folder as the view FXML files?
body: <p>I'm loving JavaFX and SceneBuilder, but I just can't figure out how to make SceneBuilder link my FXML views with their Java controllers when they are not in the same folder. I'd just like to have this folder structure:</p>
  
  <pre><code>  package
       |-- model
       |-- view
       |   |--someElementView.fxml
       |   \--anotherElementView.fxml
       \-- control
           |--someElementController.java
           \--anotherElementController.java  
  </code></pre>
  
  <p>Instead I can only make SceneBuilder recognise my controllers if I have this folder structure which I'd like to avoid:</p>
  
  <pre><code>package
   |-- model
   \-- view
       |--someElementView.fxml
       |--anotherElementView.fxml
       |--someElementController.java
       \--anotherElementController.java 
  </code></pre>
  
  <p>What happens is that when the FXML and java files are all in the same folder, SceneBuilder detects them and shows a dropdown list with the java controllers (i.e. "package.view.someElementController" and "package.view.anotherElementController") for me to choose from and everything works nicely.</p>
  
  <p>If I have a project with the folder structure with the controllers in a separate folder, SceneBuilder won't offer me any option to assign a controller class. If I just type it in the controller text field (i.e. "package.control.someElementController" or "package.control.someElementController"), it still won't pick up the @FXML variables defined in the java controller.</p>
  
  <p>Is this a bug in Scene Builder or am I approaching things the wrong way? I have always have the controllers and the views in different folders, and since it's a big project, I'd like to keep things tidy.</p>