Java event delegation model

Java event delegation model

What is the highest-level event class of the event-delegation model?
View Answers

April 12, 2012 at 2:03 PM

Event delegation model has 3 components these are Event,Listener and Source..

Events

In the delegation model, an event is an object that describes a state change in a source. Event be generated as a consequence of a person interacting with the elements in a graphical user interface. Some of the activities that cause events to be generated are pressing a button, entering a character via the keyboard, selecting an item in a list, and clicking the mouse. Events may also occur that are not directly caused by interactions with a user interface like an event may be generated when a timer expires, a counter exceeds a value, a software or hardware failure occurs, or an operation is completed.

Event Source


A source is an object that generates an event. This occurs when the internal state of that object changes in some way. Sources may generate more than one type of event. A source must register listeners in order for the listeners to receive notifications about a specific type of event. Each type of event has its own registration method. public void addTypeListener(TypeListener el) Type is the name of the event and el is a reference to the event listener. The method that registers a keyboard event listener is called addKeyListener(). The method that registers a mouse motion listener is called addMouseMotionListener().
When an event occurs, all registered listeners are notified and receive a copy of the event object know as multicasting the event In all cases, notifications are sent only to listeners that register to receive them. Some sources may allow only one listener to register. General Form: public void addTypeListener(TypeListener el) throws java.util.TooManyListenersException Type is the name of the event and el is a reference to the event listener. When such an event occurs, the registered listener is notified. This is known as unicasting the event. A source must also provide a method that allows a listener to unregister an interest in a specific type of event. The general form of such a method is this: public void removeTypeListener(TypeListener el)

Event Listener


A listener is an object that is notified when an event occurs. Listener has two major requirements. It must have been registered with one or more sources to receive notifications about specific types of events. It must implement methods to receive and process these notifications. The methods that receive and process events are defined in a set of interfaces found in java.awt.event. For example, the MouseMotionListener interface defines two methods to receive notifications when the mouse is dragged or moved. Any object may receive and process one or both of these events if it provides an implementation of this interface.









Related Tutorials/Questions & Answers:
Java event-delegation model
Java event-delegation model  What is the advantage of the event-delegation model over the earlier eventinheritance model
Java event delegation model
Java event delegation model  What is the highest-level event class of the event-delegation model
Advertisements
delegation event model
delegation event model  What is delegation event model?   delegation event model In the event-delegation model, specific objects...-listener interfaces. Advantages of event-delegation model: 1)It enables
ModuleNotFoundError: No module named 'event-model'
ModuleNotFoundError: No module named 'event-model'  Hi, My Python... 'event-model' How to remove the ModuleNotFoundError: No module named 'event-model' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'event-model'
ModuleNotFoundError: No module named 'event-model'  Hi, My Python... 'event-model' How to remove the ModuleNotFoundError: No module named 'event-model' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'delegation'
ModuleNotFoundError: No module named 'delegation'  Hi, My Python... 'delegation' How to remove the ModuleNotFoundError: No module named 'delegation' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'delegation'
ModuleNotFoundError: No module named 'delegation'  Hi, My Python... 'delegation' How to remove the ModuleNotFoundError: No module named 'delegation' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'abc-delegation'
ModuleNotFoundError: No module named 'abc-delegation'  Hi, My... named 'abc-delegation' How to remove the ModuleNotFoundError: No module named 'abc-delegation' error? Thanks   Hi, In your python
Java event handling
Java event handling  What event results from the clicking of a button
Java event-listener
Java event-listener  What is the relationship between an event-listener interface and an event-adapter class
Java event handling
Java event handling  Which java.util classes and interfaces support event handling
Java AWT event hierarchy
Java AWT event hierarchy  What class is the top of the AWT event hierarchy?  The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy
Java event handling
Java event handling  What is the purpose of the enableEvents() method
Need an Example of calendar event in java
Need an Example of calendar event in java  can somebody give me an example of calendar event of java
java swing button click event
java swing button click event  java swing button click event   public void doClick()   Java Swing Tutorials
mouse event - Java Beginners
=getContentPane(); setLayout(new FlowLayout()); setTitle("Mouse Event... Event"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(btnClose
Event handling - Java Beginners
Event handling  Hi, This is a similar kind of question i had asked before, with a little difference. Two JCombobox and a JtextField. When I select an Item from the first Combo(i.e.,Select,First,Second or Third),the set
Event Handling - Java Beginners
Event Handling  import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calculator extends JFrame { JLabel lblNumber=new JLabel("Number"); JLabel lblSquareRoot=new JLabel("Square Root
Java window state event
Java window state event  Two java windows, one on top of another... Window at the back is deactivated when the other is on the top. Can iconify when there is only one window using win+d key. In windows, press win+d, window
Event Handling In Java
Event Handling In Java In this section you will learn about how to handle.... In Java event handling may comprised the following four classes : Event Sources : Sources for generating an event may be the components. In Java
What are events? Explain how Event handling in Java?
What are events? Explain how Event handling in Java?  What are events? Explain how Event handling in Java?   Hi, The Events..., and introduces us to AWT event handling. For Details about Event Handling in Java
event-driven programming paradigm of Java. - Java Beginners
event-driven programming paradigm of Java.  Design a scientific calculator using event-driven programming paradigm of Java.  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/java/swing
Java single threaded model
Java single threaded model  How single threaded model works after implementation in class, basically architecture point of view
JComboBox Event Handling - Java Beginners
JComboBox Event Handling  Hi, I have problem with event handling here.There are Two JComboBox and a JTextField.When I select an item in first combo(Select,First,Second in the below program) the items in the second combo change
Java Swing Key Event
Java Swing Key Event In this tutorial, you will learn how to perform key event in java swing. Here is an example that change the case of characters to uppercase as the user enters any character. The given code accepts the string from
Event Listeners
Event Listeners  I want to learn the Event Listeners in Java. Any... is the good tutorial and example of Event Listeners in Java. Please check the tutorial Java - Event Listeners Example in Java Applet. Thanks
Handling Key Press Event in Java
Handling Key Press Event in Java   ... the handling key press event in java. Key Press is the event is generated when you press any key to the specific component. This event is performed by the KeyListener
Return Value From Event - Java Beginners
Return Value From Event  I would like to call a method that returns a value after an event has occurred and the value is determined by the event or listener. eg: public int mymethod() { static int value=0; KeyAdapter
Event management
Event management   Hi, I want event management application like maintaining email notifications while task creation and update in broader way using spring java
event handling
event handling  diff btwn event handling in ASP.net and in HTML
Core Java Interview Question, Interview Question
model over the earlier event-inheritance model? Answer: The event-delegation... design and its use. The other advantage of the event-delegation model.... This performance improvement is due to the fact that the event-delegation model does not have
Click event
Click event  hi............ how to put a click event on a particular image, so that it can allow to open another form or allow to display result in tabular form????????/ can u tell me how to do that????????/ using java swings
Maven dependency for net.zedge.zeppa - event-core version 2.10.0 is released. Learn to use event-core version 2.10.0 in Maven based Java projects
use this version ( net.zedge.zeppa - event-core version 2.10.0 ) in their Java... that downloads and includes  net.zedge.zeppa - event-core version 2.10.0 java...Maven dependency for  net.zedge.zeppa  - Version 2.10.0 of event
Maven dependency for net.zedge.zeppa - event-core version 2.10.3 is released. Learn to use event-core version 2.10.3 in Maven based Java projects
use this version ( net.zedge.zeppa - event-core version 2.10.3 ) in their Java... that downloads and includes  net.zedge.zeppa - event-core version 2.10.3 java...Maven dependency for  net.zedge.zeppa  - Version 2.10.3 of event
Maven dependency for net.zedge.zeppa - event-core version 2.10.6 is released. Learn to use event-core version 2.10.6 in Maven based Java projects
use this version ( net.zedge.zeppa - event-core version 2.10.6 ) in their Java... that downloads and includes  net.zedge.zeppa - event-core version 2.10.6 java...Maven dependency for  net.zedge.zeppa  - Version 2.10.6 of event
Maven dependency for net.zedge.zeppa - event-core version 2.10.9 is released. Learn to use event-core version 2.10.9 in Maven based Java projects
use this version ( net.zedge.zeppa - event-core version 2.10.9 ) in their Java... that downloads and includes  net.zedge.zeppa - event-core version 2.10.9 java...Maven dependency for  net.zedge.zeppa  - Version 2.10.9 of event
Maven dependency for net.zedge.zeppa - event-core version 2.11.1 is released. Learn to use event-core version 2.11.1 in Maven based Java projects
use this version ( net.zedge.zeppa - event-core version 2.11.1 ) in their Java...Maven dependency for  net.zedge.zeppa  - Version 2.11.1 of event-core released The developers of   net.zedge.zeppa - event-core project
Maven dependency for net.zedge.zeppa - event-core version 2.8.0 is released. Learn to use event-core version 2.8.0 in Maven based Java projects
this version ( net.zedge.zeppa - event-core version 2.8.0 ) in their Java...Maven dependency for  net.zedge.zeppa  - Version 2.8.0 of event-core released The developers of   net.zedge.zeppa - event-core project
Maven dependency for cn.herodotus.engine - event-core version 2.7.0.30 is released. Learn to use event-core version 2.7.0.30 in Maven based Java projects
to use  cn.herodotus.engine - event-core version 2.7.0.30 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.0.30 java library... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.2.2 is released. Learn to use event-core version 2.7.2.2 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.2.2 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.2.2 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.2.0 is released. Learn to use event-core version 2.7.2.0 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.2.0 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.2.0 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.1.1 is released. Learn to use event-core version 2.7.1.1 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.1.1 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.1.1 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.0.0 is released. Learn to use event-core version 2.7.0.0 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.0.0 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.0.0 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.4.5 is released. Learn to use event-core version 2.7.4.5 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.4.5 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.4.5 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.4.3 is released. Learn to use event-core version 2.7.4.3 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.4.3 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.4.3 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.4.2 is released. Learn to use event-core version 2.7.4.2 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.4.2 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.4.2 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 3.0.0-RC2 is released. Learn to use event-core version 3.0.0-RC2 in Maven based Java projects
to use  cn.herodotus.engine - event-core version 3.0.0-RC2 in Java projects... that downloads and includes  cn.herodotus.engine - event-core version 3.0.0-RC2 java... of event-core released The developers of   cn.herodotus.engine - event
Maven dependency for cn.herodotus.engine - event-core version 2.7.7.1 is released. Learn to use event-core version 2.7.7.1 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.7.1 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.7.1 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.3.5 is released. Learn to use event-core version 2.7.3.5 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.3.5 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.3.5 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core
Maven dependency for cn.herodotus.engine - event-core version 2.7.5.3 is released. Learn to use event-core version 2.7.5.3 in Maven based Java projects
; cn.herodotus.engine - event-core version 2.7.5.3 in Java projects. Follow... and includes  cn.herodotus.engine - event-core version 2.7.5.3 java library in your... of event-core released The developers of   cn.herodotus.engine - event-core

Ads