This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes how to close a popup window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to close a popup window" Watch "how to close a popup window" New topic
Author

how to close a popup window

Alex Iordache
Ranch Hand

Joined: Mar 13, 2001
Posts: 62
i've a link in my parent window. which when clicked will open a popup window. In this popup window, i've a applet running.Ive a button called exit which when clicked should close only the popup window.

But, when i use system.exit(0) it closes the popup and as well as the parent window.
Give me a better solution to close only that popup window.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Alex,
Instead of calling System.exit( 0 ) in the actionListener for the button call .setVisible( false ) on a reference to the frame or dialog that holds the popup window. i.e. the name of your popup window.
HTH,
-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Frame extends Window. Window has a dispose() method that realeases the window/frame. In the previous reply if you setVisible to false, you still has an instance of the popup. This isn't necessarily bad, if you want the applet to popup more than once in the course of the running program
Mark Spritzler


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
Don't get me started about those stupid light bulbs.
 
subject: how to close a popup window
 
Similar Threads
Update Value from a child window
Window.opener problem
window.opener performance error
checkbox and popup
Closing a parent window from a popup