hi,
for an event handling mechanism,
we need an event object. (the object where the event actually occur)
and we need an event handler,
and we need a registration of the event handler to the event object(generato r)
in java, we can create a generator class by extending EventObject class.
we can create an event handler class by implementing EventListener interface.
for registration we can provide some registration method (e.g addMyListener )
in our generator class.
my 1st question: can this registration method be like any other method, or is there any restriction on it, or does it have any special behaviour?
my 2nd question: did i figure out event handling issue correctly, or is there any missing/incorrect points?
thanks in advance...
for an event handling mechanism,
we need an event object. (the object where the event actually occur)
and we need an event handler,
and we need a registration of the event handler to the event object(generato r)
in java, we can create a generator class by extending EventObject class.
we can create an event handler class by implementing EventListener interface.
for registration we can provide some registration method (e.g addMyListener )
in our generator class.
my 1st question: can this registration method be like any other method, or is there any restriction on it, or does it have any special behaviour?
my 2nd question: did i figure out event handling issue correctly, or is there any missing/incorrect points?
thanks in advance...
Comment