Q:

Delete file on closing - JavaFX

I'm making a JavaFX application which can open Word, Excel, and PowerPoint files by converting them to a PDF. When I close the application, I don't need the converted PDF anymore. Can I delete the PDF when I close the application?

A:

You should take a look at the Application's stop method and the File's delete method. Override the stop method and delete the File in that method.

