See my jAWTRobot library. There's a function called AddShutdownHook that allows you to run a method in a new thread when the JVM is shutting down under its own power (as opposed to being shut down by the OS).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.