[2962] in java-interest
Re: AWT: handleEvent vs. action ?
daemon@ATHENA.MIT.EDU (Sami Shaio)
Tue Oct 24 00:03:39 1995
Date: Mon, 23 Oct 1995 18:08:47 -0700
From: Sami.Shaio@Eng.Sun.COM (Sami Shaio)
To: java-interest@java.Eng.Sun.COM, Amy.Moore@Eng.Sun.COM
Instead of returning false you should do the following:
return super.handleEvent(event);
--sami
|From daemon@java Mon Oct 23 18:04 PDT 1995
|Date: Mon, 23 Oct 1995 17:38:11 -0700
|From: Amy.Moore@Eng (Amy Moore)
|To: java-interest@java.Eng.Sun.COM
|Subject: AWT: handleEvent vs. action ?
|Cc: Amy.Moore@Eng
|Mime-Version: 1.0
|Content-Transfer-Encoding: 7bit
|Content-Md5: JOYVJynaF0+CJBwaZXcCvw==
|X-Info: To unsubscribe, send 'unsubscribe' to java-interest-request@java.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
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com