0

i want to execute a particular set of commands when the program exits by pressing the cross on the right hand top corner

2
  • 2
    Search for "shutdown hook" on stackoverflow. There are several other questions on this topic. Commented Jun 5, 2011 at 14:00
  • here's one example : stackoverflow.com/questions/2921945/… Commented Jun 5, 2011 at 14:04

1 Answer 1

1

Depending of what you really want to do, there are few ways to do it:
1) If you want to do it on UI level use WindowListener [link]
2) If you want to do it on JVM level, use ShutdownHooks [link]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.