Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JAVA Run code when program ends
#1
I need to run some code (unload stuff etc) when the program ends. It is a program not an applet. Anybody know the method to use?
Reply
#2
Ends how? If someone kills the VM you are fucked. How will the application be ending?
Reply
#3
Well I worked around this, but i was thinking like when I press stop in the ide. But yea, I just tweaked my code so i am not using all of the files etc at all times, and so i can unload them when I'm done using them, instead of when the program closes. Seems like a good thing to know though.
Reply
#4
http://java.sun.com/docs/books/tutorial ... tDemo.java

an example of how to setup and use WindowListener. I just started playign with it yesterday myself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)