File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes event, Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "event, Listener" Watch "event, Listener" New topic
Author

event, Listener

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635
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: 635
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: 10170
    
    8

The framework senses the action of clicking the button and generates the event


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635
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://aspose.com/file-tools
 
subject: event, Listener
 
Similar Threads
problem with parse int method
Java not for NASA?
mouseEntered method
Event Handling
Can Netbeans generated code force to be editable?