Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的应用程序关闭之前进行一些操作。
我看到有动作监听器,但我没有框架或类似的东西。只是一个唯一的java文件。
我怎样才能设置某种控制?
I want to make some actions just before my application close.
您可能正在寻找关闭挂钩:
Runtime.getRuntime().addShutdownHook(...)
这是一个 SO question(和很好的答案),询问关闭挂钩的实际用途:
Java中关闭挂钩的有用示例?