In my main controller class I have
public static final Stage fpStage =new Stage();
fpStage.setScene(scene);
fpStage.show();
okay in my secondary controller class I have
import particlesxml.MainwindowController;
this.okayButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
MainwindowController.fpStage.hide();
}//end of handle
}); //end of action event and set on action
This compiles just fine but does not work!!!. How do we close window2 brought up by java controller for window1, from java controller for window2.
fpStage for my project is the Stage (window) for Window2.