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?
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: