I´ve got 2 different screens, in the first screen the user can load images and the other one is just a single button (the stage is invisible so the stage has to be different
if the primaryStage is where "user can load images" do :
static Stage primaryStage;
@FXML
private void goToScreen1(ActionEvent event) throws Exception{
Stage stage = (Stage) showStage.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/sample.fxml"));
Parent root = fxmlLoader.load();
if(primaryStage==null)
primaryStage = new Stage();
primaryStage.setResizable(true);
primaryStage.setOpacity(0.0);
primaryStage.show();
primaryStage.setX(0);
primaryStage.setY(0);
primaryStage.setHeight(primScreenBounds.getHeight());
primaryStage.setWidth(primScreenBounds.getWidth() / 2);
}