This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Window Close Conformation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Window Close Conformation" Watch "Window Close Conformation" New topic
Author

Window Close Conformation

S.Subhash Chandran
Greenhorn

Joined: Dec 31, 2002
Posts: 27
I have a JOptionPane conformation in the WindowListener class. If the user presses "Yes" the application quits "System.exit(0)". Else, nothing should happen. But the application's frame object's visibility is automatically set to false after executing my JOptionPane routine...
What to do?


Subhash Chandran S<br /><a href="http://www.indiwiz.com/" target="_blank" rel="nofollow">http://www.indiwiz.com/</a>
S.Subhash Chandran
Greenhorn

Joined: Dec 31, 2002
Posts: 27
Got it! Just add:
jfObj.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
before u addWindowListener() to jfObj.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Window Close Conformation
 
It's not a secret anymore!