In Netbeans, after running a project (by clicking F6), how can I stop that running progress as if it were shutdown by the OS (not cancel it)?
On the Output windows of Netbeans, there is only a cancel button, which cancels the running process.
In my program, I handle the shutdown event (addShutdownHook
), and cancelling the running progress doesn't program jump to shutdown code handler.
Runtime.getRuntime().addShutdownHook(new StopThread());