public void showCreateProjectDialog(final ActionEvent actionEvent) { try { final String fxmlPath = "/fxml/creating.fxml"; final String title = "Create new project"; Stage createWindowStage = new Stage(); Parent root = FXMLLoader.load(getClass().getResource(fxmlPath)); createWindowStage.setTitle(title); createWindowStage.setResizable(false); Scene scene = new Scene(root); createWindowStage.setScene(scene); createWindowStage.initModality(Modality.WINDOW_MODAL); createWindowStage.initOwner(((Node) actionEvent.getSource()) .getScene().getWindow()); createWindowStage.show(); } catch (IOException e) { e.printStackTrace(); } } The part of the code where the error is, found:
createWindowStage.initOwner(((Node) actionEvent.getSource()) .getScene().getWindow()); I can not establish the cause of the error. The only thing that I can assume is to blame
fx:controller which is written in fxml. What other options might there be?