×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Hani Ibrahim
Added: Dec 30, 2016 1:51 AM
Modified: Dec 30, 2016 8:04 AM
Views: 16
Do tasks when quit the program. Put in the jframe constructor.
  1. Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
  2.         @Override
  3.         public void run() {
  4.                 // Code
  5.         }
  6. }));