Stop user from pressing the form [X] close button???

If the user clicks the main close button of the form how can I trap that event and decide if I want it to work or not. There are conditions in my application where closing it using that form close button is not safe. How can I handle that gracefully?

2 comments
Comment actions Permalink

Never mind. I had a different problem in my code that was making this necessary. I fixed my problem and this is no longer necessary.

However, if you know how to do it I would still be interested.

- Rex

P.S. Many of you have been very helpful and I really appreciate it.

0
Comment actions Permalink

internalFrameListener.internalFrameClosing(InternalFrameEven
t) or windowListener.windowClosing(WindowEvent)

"Rex Winn" <no_mail@jetbrains.com> wrote in message
news:25686851.1116479355334.JavaMail.javamailuser@localhost...

Never mind. I had a different problem in my code that was

making this necessary. I fixed my problem and this is no
longer necessary.
>

However, if you know how to do it I would still be

interested.
>

- Rex

>

P.S. Many of you have been very helpful and I really

appreciate it.


0

Please sign in to leave a comment.