This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes event, Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "event, Listener" Watch "event, Listener" New topic
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

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: event, Listener
 
Similar Threads
Can Netbeans generated code force to be editable?
problem with parse int method
Event Handling
mouseEntered method
Java not for NASA?