Thursday, December 13, 2012

Event Handling in Java - Assignment 2


The objective of this assignment is to understand events handling in abstract way. We have used events with GUI components, but events are not only associated with GUI components. You can define events and fire them even when there is no GUI of your application.

In this assignment you are supposed to create ResultAnnouncedEvent which is fired by ExaminationCenter. Different entities (or classes) can register themselves as listeners so that when result is announced they are notified, for example Student, Teacher and Administrator. So these classes are event listeners. These classes should just receive the event and print the event attributes. The ResultAnnouncedEvent class should be composed of class, section, and date attributes. Also create ExaminationCenterTest class that fires the event.

Before doing this assignment, it is recommended you read API docs of java.util.EventObject, java.util.EventListener.

Also See: http://www.jguru.com/faq/view.jsp?EID=98547

Due: Next Lab.

1 comment: