java listen for application to exit code example
Example: java program finish event
Runtime.getRuntime().addShutdownHook(new Thread()
{
@Override
public void run()
{
//do your stuff
}
});
Runtime.getRuntime().addShutdownHook(new Thread()
{
@Override
public void run()
{
//do your stuff
}
});