title: Splitting up JavaFX Controller Class
body: <p>I do not have a MCV Code Example because the problem is more global and I don't think the specific code actually makes a big difference. </p>
  
  <p>I have a GUI application with several Elements (datepickers, dropdown, entry fields, tabletreeview) and as per JavaFX one ControllerClass which got pretty big over the time. </p>
  
  <p>Consequently I was looking into a way to split it up. In my research I found two main ways to do this: </p>
  
  <p>Getting more of the program logic out of the UI part, which of course always makes sense and I did that for some parts, but for many it seems pretty unhandy, for example if I have a function that uses six different GUI elements it seems weird to extract that method out of the controller class, since I need to give it all those GUI elements references in the function call. Is there some better defaut way I'm missing? Like populating the Controller Class just with setters/getters and giving every method <code>this</code> as parameter so it can go <code>this.dropbox1</code>? </p>
  
  <p>A second way I found was to split up the GUI itself into several scenes. Like <a href="https://stackoverflow.com/questions/39757014/javafx-how-to-avoid-creating-one-huge-controller">this</a> question, but I have no idea how to split up one GUI into several scenes and still have it in one window. I do realize that you can load other FXML files in your main-FXML file but I'm not sure how to combine them into a GUI in one window. If somebody had a little example code for this, I'd be grateful. </p>