IntelliJ Java IDE
The moose likes Applets and the fly likes Window Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Window Problem" Watch "Window Problem" New topic
Author

Window Problem

Ajit Kumar
Ranch Hand

Joined: Jan 27, 2001
Posts: 81
hi Guys,
I have the following code for window closing event
--------
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
int exitApp= JOptionPane.showConfirmDialog(null,
"Do you really wish to exit the application", "Please Confirm", JOptionPane.YES_NO_OPTION);
if (exitApp==JOptionPane.YES_OPTION){
System.exit(0);
}
}
});
---------
When i am closing the window, the message is getting displayed. If i choose NO for closing the window is not remaining. It is just disappearing. I am sure it is not closing.
How do i make sure that, the window remains there, when i choose the NO option for the confirmation message???
any suggestions willbe greatly appreciated.

thanks in advance.
 
 
subject: Window Problem
 
Threads others viewed
JavaScript
parent window notification
Cancelling close in windowClosing
Window Closing Event
making "Exit" option in JMenu
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture