I'm programming with Java in Linux using Netbeans 7 and as my program (sometimes) could not exit (not in this eon, maybe) I create a thread to handle shutdown
Runtime.getRuntime().addShutdownHook(new StopThread());
But when I launch the code with netbeans (F6) and stop it through the "STOP" button the thread is not created; but if I run the program through the terminal and send CTRL-c the thread is created.
The question is: what type of signal netbeans launches to terminate the program?
Or (better): how can i handle the stop of netbeans such that the thread is created if i force to stop the program?
Or is there a way to modify how the stop works?
Thank you!