Not really that familiar with Swing, and am writing a client-server UDP chat application. Everything is working fine, except I would like my clients to send a notification to the server and to close the DatagramSocket when their windows are closed. Where do I put my code so that it executes upon closing the window?
Not really that familiar with Swing, and am writing a client-server UDP chat application.
Share
Register a
WindowAdapterto the container and override it’swindowClosingmethod.Example
where
foois your container instance.