NCSAHabanero

[ Previous ] [ Index ] [ Next ]

-------------------------------------------------------------------
How to generate an event
-------------------------------------------------------------------

Habanero.sendEvent()

Background Information

 Sometimes you want to generate a new event, apart from events users cause. At other times, a user may cause some event, but you want to propagate a different kind of event.

For example, the user could press a button and you want to send the contents of a field instead of the normal button event.

How does this work?

To generate a new event, call the method Habanero.sendEvent(AWTEvent), passing it the event you want to send.

 
Example
protected void processActionEvent(ActionEvent e) 
{ if (e.getSource() != null) 
  { Habanero.sendEvent(e); 
  } 
  else 
    // Deal with the case of there being no source. 
}

What next?

Learn how to package up complicated extra data in your event.


Habanero® is a registered trademark owned by The Board of Trustees of the University of Illinois. Copyright 1996-1998. All rights reserved.   Java(TM) is a proprietary trademark owned by Sun Microsystems, Inc.
NCSA
The National Center for Supercomputing Applications

University of Illinois at Urbana-Champaign

Contacts page