[2961] in java-interest
AWT: handleEvent vs. action ?
daemon@ATHENA.MIT.EDU (Amy Moore)
Mon Oct 23 23:29:55 1995
Date: Mon, 23 Oct 1995 17:38:11 -0700
From: Amy.Moore@Eng.Sun.COM (Amy Moore)
To: java-interest@java.Eng.Sun.COM
Cc: Amy.Moore@Eng.Sun.COM
I'm writing a java application and am running into some
problems handling events and actions using AWT...
On a class that extends Frame, I have an action() method which
nicely handles all the GUI behavior in the window (button presses,
menu-item selections, etc).
When I add a handleEvent() method to catch the WINDOW_DESTROY event,
suddenly my action() method is no longer called (I'm only
returning true if it's a WINDOW_DESTROY event):
public boolean handleEvent(Event event) {
if (event.id == Event.WINDOW_DESTROY) {
System.exit(0);
return true;
}
return false;
}
Shouldn't events which are of type ACTION_EVENT fall-thru
to my action() method?
Any clues appreciated,
Amy Moore-Fowler
SunSoft, Inc.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com