disconnection on exit

  • Thread starter Brandon McCombs
  • Start date
B

Brandon McCombs

hello,

My application connects to an LDAP server and upon exiting my app I want
to disconnect from the directory server. I have a File->Exit menu
option but what happens if a user clicks on the X in the corner of the
window? Where do I place my disconnection method to handle that? Do I
have to change what the default close operation is for the JFrame?

thanks
 
J

JScoobyCed

Brandon said:
hello,

My application connects to an LDAP server and upon exiting my app I want
to disconnect from the directory server. I have a File->Exit menu
option but what happens if a user clicks on the X in the corner of the
window? Where do I place my disconnection method to handle that? Do I
have to change what the default close operation is for the JFrame?

thanks

You can use the WindowListener and the
void windowClosed(WindowEvent e)
method.
 
B

Brandon McCombs

JScoobyCed said:
You can use the WindowListener and the
void windowClosed(WindowEvent e)
method.

ah that's it. I completely forgot about that. Thanks.
 
B

Brandon McCombs

JScoobyCed said:
You can use the WindowListener and the
void windowClosed(WindowEvent e)
method.
I had to use windowClosing() method but I think it's doing what I want
since I saw output from my System.out.println() methods when I did not
see output when I used windowClosed().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top