انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Handling Event in Java

الكلية كلية تكنولوجيا المعلومات     القسم قسم شبكات المعلومات     المرحلة 3
أستاذ المادة مهدي عبادي مانع الموسوي       12/01/2017 17:37:55
Handling Event in Java
1. What is an Event ?
When the user performs an action at the user interface level (click a mouse or process a key), this causes an event to be issued. Events are an object that describes what has happened. A number of different types of event classes exist to describe different categories of user actions. Summarization of event can be described as:-
• Events – Objects that describe what happened
• Event sources – The generator of an event
• Event handlers – A method that receives an event object, deciphers it, and processes the user’s interaction




Example:


2. Delegation model
The delegation event model sent events to the component from which the events originated, but it is up to each component to propagate the event to one or more registered classes. Called listener. Listeners contain event handlers that receive and process the event. In this way, the event handler can be in an object (class) separate from the component. Listener are classes that implement the EventListener interface.
• An event can be sent to many event handlers.


• Every events has a corresponding listener interface that mandates which method must be defined in a class suited to the receiving that type of event.


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .