Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Window Close Conformation

 
S.Subhash Chandran
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
S.Subhash Chandran
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it! Just add:
jfObj.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
before u addWindowListener() to jfObj.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic