java - close the application buttonListener -


i writing client gui server program. gui , component buttons in class extends jframe.

what need button listener tells server message in event client hits close button on jframe gui.

i know

  setdefaultcloseoperation(exit_on_close); 

will terminate application if button pressed, can't notify server before program terminates.

use in class

 windowadapter wa = new windowadapter()     {         public void windowclosing(windowevent we)         {             /*inform server*/         }     };      addwindowlistener(wa); 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -