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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -