[5033] in java-interest

home help back first fref pref prev next nref lref last post

Re: Event processing

daemon@ATHENA.MIT.EDU (Amy Fowler)
Fri Jan 26 13:59:56 1996

Date: Fri, 26 Jan 1996 08:51:41 -0800
From: Amy.Fowler@Eng.Sun.COM (Amy Fowler)
To: java-interest@java.Eng.Sun.COM, tgee@eecs.umich.edu


>>
>>Seems like, according to the API, events will be passed to a parent's
>>handleEvent() rountine if the child's handleEvent() returns false.
>>
>>I have a class:
>>public class RepApplet extends Applet {
>>
>>	public synchronized boolean handleEvent(Event e) {
>>		System.out.print("Event:  ");
>>		System.out.println(e.toString());
>>		return true;
>>	}
>>}
>>
>>
>>And then another class which extends RepApplet.  The second class always
>>returns 'false' from its handleEvent() but RepApplet.handleEvent() never
>>gets called.  Anyone have any wisdom regarding this?

You need to call "return super.handleEvent(e)" to pass
the event up the chain if your method doesn't wish to absorb it.

Regards,
Amy Moore-Fowler
Java Products Group
Sun Microsystems, Inc.

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post