Hi, I think I have been always confused with this event topic. In Java, whenever I touched event before, it is GUI related, as adding a listener and so on. However, if I want to build an event in a non-GUI program, for example, start a timer in a class to check time, which changing the content of a hashtable based on the msg it got from a network, the EVENT of the change this hashtable may trigger another action as updating another hashtable somewhere, which depends how the first hashtable get updated. I know this example can be done without using any Event model, but just wondering how I can do it in Java (I can easily do it with the delegation concept in C#)? Is there any routine class build-in to help me do that? Thanks a lot Chris
Hi James, Thank you very much! It is definitely a great article for a jump start. If you or anyone have any other good resource about this topic, please also let me know (for some reasons, I did not find it in Java tutorial in Sun website :-( ). Thanks again Chris
James Swan
Ranch Hand
Joined: Jun 26, 2001
Posts: 403
posted
0
Hi Chris, This is another article from that same site, which has more of an introduction to it. http://www.javaworld.com/javaworld/jw-10-1996/jw-10-howto.html Also if you don't want to go down the Observer/Observable path, here is another article explaining writing custom events/listeners/handlers. James. [ April 19, 2002: Message edited by: james swan ]
Chris Ben
Ranch Hand
Joined: Jan 15, 2001
Posts: 135
posted
0
Very helpful!!! It saves me a lot of time in searching the right resource. Thanks a lot James. Have a good weekend Chris