Home arrow Java arrow Listeners in Java
JAVA

Listeners in Java


Peter has written this article to help DevArticle readers learn how to create their very own listener interface with Java. A great read for those learning the Java language.

Author Info:
By: Peter Lavin
Rating: 4 stars4 stars4 stars4 stars4 stars / 58
August 07, 2003
TABLE OF CONTENTS:
  1. · Listeners in Java
  2. · Article
  3. · Conclusion

print this article
SEARCH DEVARTICLES

Listeners in Java
(Page 1 of 3 )

This article seeks to demystify listener interfaces in Java. For example, if you have come to Java from Visual Basic, listeners can seem confusing. If you use a button in VB it comes ready-made with a click event. The programmer doesn’t have to worry about how or where mouse or keyboard events will be processed. Not so in Java. Objects are not already event-enabled.

In what follows we will assume some familiarity with one of the most commonly used listeners, “ActionListener”. We will then create our own listener interface. This is a lot easier than you might think. Any beginner to intermediate level Java programmer should benefit from this discussion. Java conventions for capitalisation of classes and interfaces will be used for all built-in and programmer created classes. When referring to generic classes, for example, “listeners”, lower case names will be used.


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials