CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    TamilNadu, India
    Posts
    42

    creating the user defined event

    Hello,
    Please tell the procedure of creating the user defined event.

    Thanks in advance
    Shankar


  2. #2
    Join Date
    Apr 1999
    Location
    Bangalore,India
    Posts
    43

    Re: creating the user defined event

    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...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured