Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Close Parent Window When Child Window Closes

 
Brandon Golway
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the dispose() method of the JFrame to close the window on some action.
 
Brandon Golway
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it out, thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic