wood burning stoves*
The moose likes Beginning Java and the fly likes how to close or exit of one of two opened windows? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to close or exit of one of two opened windows?" Watch "how to close or exit of one of two opened windows?" New topic
Author

how to close or exit of one of two opened windows?

Mindy Wu
Ranch Hand

Joined: Jan 12, 2001
Posts: 121
Hello all,
I created a swing application e.g A, when use clicks a button in A, it will display B ( another swing interface). My question is how to close B when user clicks Close Button in B without close A.
I know you can set
"frame.setDefaultCloseOperation JFrame.DISPOSE_ON_CLOSE);" to close the frame when user clicks x. If i use System.exit(0), it will cause all of the opening swing screen exit.
Wating for you help!
Thanks!
Mindy
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
frame.dispose();


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to close or exit of one of two opened windows?
 
Similar Threads
Message Box Functionality
dialog example Urgent
Message Box Functionality
Message Box Functionality
Messasge Box Functionality