This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Close Parent Window When Child Window Closes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Close Parent Window When Child Window Closes" Watch "Close Parent Window When Child Window Closes" New topic
Author

Close Parent Window When Child Window Closes

Brandon Golway
Greenhorn

Joined: Oct 19, 2010
Posts: 23
First off, I dont mean I want the program to end. What I have setup is a simple game that shows pop-up windows that are either Info or Input windows and I would like to know how to close a child's window when it's child window closes.

So far its like this: Main Input Window launches Attack Input Window which launches an Information window. I want to know how to close the Attack Input window when "ok" is clicked on the Info window.

Heres the code related to it
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3056
    
  33

You can use the dispose() method of the JFrame to close the window on some action.


Mohamed Sanaulla | My Blog
Brandon Golway
Greenhorn

Joined: Oct 19, 2010
Posts: 23
I figured it out, thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Close Parent Window When Child Window Closes
 
Similar Threads
Dispose
What is wrong with my code?
parsing from JTextField to double
Too many ActionEvents after button press.
Create Bar Chart