How do I close a Jframe from inside a JFrame?
Goto page 1, 2 Next
|
| View previous topic :: View next topic |
| Author |
Message |
Shirley Kidman
Joined: 21 Jun 2006 Posts: 30
|
| How do I close a Jframe from inside a JFrame? |
| |
|
|
|
|
jomanda
Joined: 19 May 2006 Posts: 70 Location: Germany
|
this.setVisible(false);
this.dispose(); |
| |
|
|
Shirley Kidman
Joined: 21 Jun 2006 Posts: 30
|
| that just makes the contents of the JFrame disappear |
| |
|
|
jomanda
Joined: 19 May 2006 Posts: 70 Location: Germany
|
System.exit(0);
Or send a WM_CLOSE message to the window.
Lots of ways. Define "close". |
| |
|
|
Shirley Kidman
Joined: 21 Jun 2006 Posts: 30
|
I want the window to not be seen anymore
If I system.exit(0) everything dies... |
| |
|
|
jomanda
Joined: 19 May 2006 Posts: 70 Location: Germany
|
| I believe there's an event handler built into the JFrame for closing as well. |
| |
|
|
Poolkop
Joined: 01 Jun 2006 Posts: 123
|
| SetVisible(false) |
| |
|
|
Shirley Kidman
Joined: 21 Jun 2006 Posts: 30
|
just makes contents go away |
| |
|
|
jomanda
Joined: 19 May 2006 Posts: 70 Location: Germany
|
| DEFINE "CLOSE". |
| |
|
|
Poolkop
Joined: 01 Jun 2006 Posts: 123
|
| It gets GC'd eventually |
| |
|
|
| Page 1 of 2 |
Goto page 1, 2 Next |
|
|