This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "windowlistener" Watch "windowlistener" New topic
Author

windowlistener

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
Sunita,
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.

hth,
Sandeep
srikrish
Ranch Hand

Joined: Sep 12, 2000
Posts: 63
Sunita,
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.
Srikrish.
Sunita Vontel
Ranch Hand

Joined: Aug 28, 2000
Posts: 72
Thank u so much sandeep and srikrish
It worked.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: windowlistener
 
Similar Threads
Continuation of basic principles
Applet
this.changeLabel
Why the button doesn't appears in the Frame?
array of objects