Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Click button to close popup window

 
Phoebe Song
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Phoebe Song
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the dispose() method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic