Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Window Closing...  RSS feed

 
Sathish Babu Adluru Subas
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I've used the foll. code for window closing.The prob. is that when i press cancel button also,the window closes but doen't terminate the application. can anyone help me please...thankx in advance...
public class WindowHandler extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
if(JOptionPane.showOptionDialog(null,"Wanna quit the Application ?" , "Quit", JOptionPane.WARNING_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null,null,null) == JOptionPane.OK_OPTION)
System.exit(0);
}
}
 
Thandapani Saravanan
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a return statement at the end.
 
Sathish Babu Adluru Subas
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you seem to be tamilian,is it? anyway,thank you saravanan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!