aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Click button to close popup window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Click button to close popup window" Watch "Click button to close popup window" New topic
Author

Click button to close popup window

Phoebe Song
Ranch Hand

Joined: Jan 17, 2002
Posts: 54
I've a assignment that needs to click button to close a popup window. How do I do that? It's urgent, thank you very much.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Phoebe Song:
I've a assignment that needs to click button to close a popup window. How do I do that? It's urgent, thank you very much.


Hi Phoebe. First ease up a bit. You need to show some effort here. In Swing there really is no such thing as a "popup window". There are dialogs which are typically an instance of some JDialog. If you could read the links I posted and then maybe ask some questions that will allow us to help you, that would be great.

Thanks.


GenRocket - Experts at Building Test Data
Phoebe Song
Ranch Hand

Joined: Jan 17, 2002
Posts: 54
You are right. It is a JDialog, and there is JButton on it. My assignment is when I click the JButton, JDialog window is closed. Below is my code, I was trying to close the window when bnCridOK is clicked. Thank you.

[ December 12, 2007: Message edited by: Gregg Bolinger ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Look at the dispose() method.
 
Don't get me started about those stupid light bulbs.
 
subject: Click button to close popup window