I have a Frame that I have subclassed. When I click the "X" on the frame, I
can set the frame hidden by catching the windowClosing event in the Window
Adapter. I can also see this event occur if I instantiate the frame from
another class and set up a Window Listener on it.
Now, in addition to the "X" icon, I also have a "Close" button in the
subclassed frame. In the button's actionPerformed Actionevent handler, I
call my OnClose() routine (see below). When this happens, I also would like
a windowClosing event to fire, so other classes can determine that the
window is closing.
However, the code below is not accomplishing that, where I try to "manually"
fire the event. No event is seen in my other class (which *does* see an
event if I click the "X").
Ideas ? I tried it two different ways below, no luck.
private void onClose()
Event Windowclosing;
// Seems to be not working
java.awt.event.WindowEvent WINDOW_CLOSING; // Doesn't seem to work
either
this.setVisible(false);
// Window does disappear
}
Thanks in advance.progr
---
Frank
Dariusz.
Frank Stillwell <stil...@Adelphia.Net> wrote >
>
> However, the code below is not accomplishing that, where I try to
"manually"
> fire the event. No event is seen in my other class (which *does* see an
> event if I click the "X").
>
> Ideas ? I tried it two different ways below, no luck.
>
> private void onClose()
>
>
> Event Windowclosing;
> // Seems to be not working
> java.awt.event.WindowEvent WINDOW_CLOSING; // Doesn't seem to work
> either
> this.setVisible(false);
> // Window does disappear
> }
>
> Thanks in advance.
>
> ---
> Frank
--
Charlie Byrne * Delray Beach, FL * Mailto:CFB...@Adelphia.Net