I have the following code:
Parent parent = FXMLLoader.load(Main.class.getResource("JanelaPrincipal.fxml"));
in the fxml file there is a reference to the controller class. How can I get the controller object?
fxml:
<AnchorPane id="AnchorPane" fx:id="root"
prefHeight="768.0" prefWidth="1024.0" xmlns:fx="http://javafx.com/fxml/1"
xmlns="http://javafx.com/javafx/2.2"
fx:controller="br.meuspila.javafx.JanelaPrincipalController">
...