Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

event, Listener

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The framework senses the action of clicking the button and generates the event
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best tutorial about event handling in JAVA:

http://chortle.ccsu.edu/java5/Notes/chap57/ch57_9.html

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic