Is there a way for a Java GUI application that, in addition to using JNI, responds to system shutdown or lossoff events is? (On Windows, JNI will use WM_QUERYENDSESSION on Linux?)
The method should allow the user to encourage the program to save etc., and then continue the logoff process.
As far as I know, there is no way in Java to capture system shutdown or logoff events is not.
However, when JVM is ending, it can catch.
There is a window closure close to the AWT, which you can override and hook on the window that you want to monitor, swing it inherited; I believe SWT also does well, keep in mind that if you override this incident, you will have to manually fix the window!
I believe MS Windows will shut down these events because it is shutting down. I believe that a SIGTERM is similar to Linux / UNIX, although Linux will download an app soon if it happens during shutdown.
Comments
Post a Comment