Coding the closing of an application

2

Hello, good afternoon everyone!

I have a problem with the company software. I created a serverSocket when starting the application, and with this I can control so that only one application opens on the same machine. However, when I close the system, I need to give a .close to the created serverSocket so that access to the system is enabled.

I can not in any way create a method that is called in the act of closing the system. In addition to controlling the socket, there are numerous needs that could be implemented at the close of the application. So I really need your collaboration. Thank you.

    
asked by anonymous 05.04.2017 / 20:50

1 answer

0

In your main class, that is, that extends from Application and has the start(Stage stage) method implemented, override the stop() method and implement whatever you want in it:

@Override
public void stop(){
    // TODO
}
    
05.04.2017 / 21:12