2

I want to make some actions just before my application close.

I see there are action listeners but i have no frame or similar thing. Just an only java file.

How can I able to set some kind of control?

kubudi
  • 658
  • 1
  • 9
  • 20

1 Answers1

6
I want to make some actions just before my application close.

You're probably looking for a shutdown hook:

Runtime.getRuntime().addShutdownHook(...)

Here's a SO question (and great answers) asking for practical uses of shutdown hooks:

Useful example of a shutdown hook in Java?

Community
  • 1
  • 1
TacticalCoder
  • 6,275
  • 3
  • 31
  • 39