I tried almost every available solution but nothing seems to work I need to pass a string
between 2 Javafx scenes, but when I click to navigate to the next scene nothing happens. here's my code so far:
String myVariable = "test";
FXMLLoader loader =new FXMLLoader(getClass().getResource("/fxml/Comments.fxml"));
Parent root = null;
CommentsController commentsController = new CommentsController();
commentsController = loader.getController();
commentsController.transferMessage(myVariable);
Stage stage = new Stage();
stage.setScene(new Scene(root));
stage.show();
PS: I have transferMessage()
method set-up in the second scene.