How to prevent a window from closing?
Hi,
How do I prevent a window from closing. I
handled the windowClosing event where I display
a confirmation message to the user. If he/she
clicks no, the window should remain active.
I don't call system.exit(0) when the user
clicks no but the window closes still.
Please reply.
Kannan
Re: How to prevent a window from closing?
I guess that you might dispose the resource of your Window object.
Frame.dispose() ?
If it is the point, you may consider to remove it from your code.
good luck
Alfred Wu
Re: How to prevent a window from closing?
Sorry, I tried that already. It didn't work.
Any other suggestions ?
Kannan
Re: How to prevent a window from closing?
If your frame is JFrame , set "setDefaultCloseOperation(int operation)" to "DO_NOTHING_ON_CLOSE"