File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes windowlistener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "windowlistener" Watch "windowlistener" New topic


Sunita Vontel
Ranch Hand

Joined: Aug 28, 2000
Posts: 72
Can somebody please explain why when I click on the x button in the top right corner the window is not exiting why??

Sandeep Potnis
Ranch Hand

Joined: Aug 18, 2000
Posts: 39
You need to order the frame to get outta there, you can't just hint at it.
Try adding System.exit(0); to your windowClosing() method.

Ranch Hand

Joined: Sep 12, 2000
Posts: 63
These are the modifications that you need to do to get what you are looking for:
1. Change WindowClosing method name to windowClosing.
2. Check that you are closing all the braces for the inner class correctly.
3. Add System.exit(0) statement after the println statement in your windowClosing method.
That should make the code work. Let me know if you run into any problems.
Sunita Vontel
Ranch Hand

Joined: Aug 28, 2000
Posts: 72
Thank u so much sandeep and srikrish
It worked.
I agree. Here's the link:
subject: windowlistener
It's not a secret anymore!