I'm calling a method to load a window by passing some parameters to a specific internal method of this window, but I've got this exception:
GRAVE: null
javafx.fxml.LoadException: Controller value already specified.
unknown path:12
here is my method
public void openDef(String sys, String comp, String code) throws Exception {
Stage defStage = new Stage();
FXMLLoader loader = new FXMLLoader();
DefTableController cont = new DefTableController();//calling class controller
loader.setController(cont);
Parent frame = loader.load(getClass().getResource("defTable.fxml").openStream());
cont.getSysChoice(sys, comp, code);//call the method by passing parameters
Scene sceneDef = new Scene(frame);
defStage.setTitle("Défaillance du " + comp);
defStage.setScene(sceneDef);
defStage.show();
}
I don't understand why it consider that the controller is already set? and how to fix that ? thank you