Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Closing a window from the controller of that window

971758Nov 8 2012 — edited Nov 16 2012
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2012
Added on Nov 8 2012
11 comments
10,256 views