An FXML newbie question. I have a JavaFX Application class which does not do a whole lot (anymore) other than setting up the scene, and a controller class which gets instantiated when the FXML file is loaded and where I moved much of the logic (because seemingly the main class and the controller class are not really aware of one another).
However, I have a method which sets up setOnDragDropped on the scene. Normally, my main app would handle drag events, but because of FXML, that logic needs to be in the controller now (for File->Open for example). I have not found a way to setup DragDrop from the controller because the "scene" is only known in the main class. And since I don't instantiate the controller directly (indirectly instantiated when FXML file is loaded), I can't pass it object references easily.
How can I link the main and controller so I can have a bit more flexibility in where I put the logic? Or how can I migrate the scene dragDrop handler to the controller?
Thanks