mmsreddy
asked on
How to call a method when JDialog window is closing?
Hi
i want to call a method when the JDialog is closing?.
i have tried with
protected void processWindowEvent(WindowE
but it is not entering into that method while closing the window.
please give me a sample code
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The call to the JDialog is triggered somewhere in that code, or any other controlling class that you might have. They you only have to make that call directly after the control returns from the JDialog. There are many different possiblities. You can set a boolean variable to be changed if the proper actions were taken, if not correctly performed then trigger the new method--ie a JOptionPane message.
I usually get rid of the JDialog with the 'dispose();' method, returning control to the calling class.
But since you are wanting to close the program entirely with a system exit, then this is just food for thought.
Tom