/** * La méthode initLayouts permet de récupérer notre vue AjoutCompetition.fxml et appelle le * controller qui lui est lié. */ public void initLayouts() { try { FXMLLoader loader = new FXMLLoader(); loader.setLocation( AjoutCompetition.class.getResource("../../view/Competition/AjoutCompetition.fxml")); GridPane panelPrincipal = (GridPane) loader.load(); panelPrincipal.setStyle("-fx-background-color : " + MonAppli.COLORFENETRE + ";"); rootLayout = new BorderPane(); rootLayout.setPrefWidth(panelPrincipal.getWidth()); rootLayout.setPrefHeight(panelPrincipal.getHeight()); Scene scene = new Scene(rootLayout); this.setScene(scene); rootLayout.setCenter(panelPrincipal); AjoutCompetitionController controller = loader.getController(); controller.setStagesCompetition(this, stageGestion); } catch (IOException e) { e.printStackTrace(); } }