When I create a screen in the Scene Builder in JavaFX, three buttons in the upper corner of the screen are as default: minimize , maximize , and close .
My question
How can I manipulate and implement the click event of the close (X) button, so that when the user clicks close I execute some action or method?