How do you detect when an App is open or closed?
At this point how do you have the browser detect if the App is able to launch or unable to launch, if the app has launched and closed by the user?
Do you registered the class containing windowClosing()
method via addWindowListener()
?
Java explicitly allows you to close process, please check below code:
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
// you can write your code here
}
});