Hello,
Please tell the procedure of creating the user defined event.
Thanks in advance
Shankar
Printable View
Hello,
Please tell the procedure of creating the user defined event.
Thanks in advance
Shankar
First thing u have to do is your Event should extend a existing Event for ex.AWTEvent.
Then write a Listener interface for your event which implements EventListener. Write a Adapter for the Listener and implement the methods there that u have included in your own Listener interface.
Then write a method called processXXXEvent(XXXEvent) which handles the dispatching of events generated to the listener that are registered for the component. Apart from that in your component class u have to add addXXXListener() and removeXXXListener() methods. Overide the processEvent() so that if your event has occured then call your event processor i.e processXXXEvent() to do the rest. In your processEvent(), if event for your component has occured , create your Event object and call your processXXXEvent() with that Event object as parameter.
If u can't understand mail me . [email protected]
I hope this will help u.
regards,
arun...