| Author |
event, Listener
|
abalfazl hossein
Ranch Hand
Joined: Sep 06, 2007
Posts: 602
|
|
An event source (like a button) creates an event object when the
user does something that matters (like clickthe button) . Most
of the code you write (and all the code in this book) will receive
events rather than create events. In other words, you'lJ spend
most of your time as an event listenerrather than an event source.
Every event type has a matching listener interface. If you want
MouseEvents, implement the MouseListener interface.
An event is clicking the mouse? or button itself?
May you show me by code which one is listener and which one is event?
|
 |
Kocha Sapam
Ranch Hand
Joined: Aug 04, 2012
Posts: 35
|
|
Please clarify your question a bit ;) we will see what you really mean.
Edit : i misread your message and a typo
Regards - Kocha
|
 |
William P O'Sullivan
Ranch Hand
Joined: Mar 28, 2012
Posts: 860
|
|
The Listener responds to an Event.
The Event is created by the framework for you.
Some Events can be "faked", but for almost all usage, using the ones instantiated
in response to the user activity within a Listener will satisfy your needs.
WP
|
 |
abalfazl hossein
Ranch Hand
Joined: Sep 06, 2007
Posts: 602
|
|
William P O'Sullivan wrote:The Listener responds to an Event.
The Event is created by the framework for you.
Some Events can be "faked", but for almost all usage, using the ones instantiated
in response to the user activity within a Listener will satisfy your needs.
WP
I click then button, this is event,Now framework create event?
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
|
The framework senses the action of clicking the button and generates the event
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
abalfazl hossein
Ranch Hand
Joined: Sep 06, 2007
Posts: 602
|
|
The best tutorial about event handling in JAVA:
http://chortle.ccsu.edu/java5/Notes/chap57/ch57_9.html
|
 |
 |
|
|
subject: event, Listener
|
|
|