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.