I have used shutdown hooks before in java apps however not in java swing. I want to add a shutdown hook to scala swing app. Scala swing has no main method so i have no idea how to implement it I want to run a few methods just before closing so if there other ways beside the shutdown hook please suggest.
Have you looked inside SwingApplication
?
There is a main
or a startup
to register Runtime.addShutdownHook
.
Or there is a shutdown
template method if that's all you mean.