Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Beans Events

Beans Events

  • So, as we said before, you also have another way which you can handle events. This is the Java 1.1 methodology.

  • The JDK 1.1 model provides two related options for event handling: listeners and adapters. In the first case, you can use listener interfaces to catch events by creating a class that listens for events from other classes. To use listeners, a listener object implements a listener interface and tells the object it wants to listen to that it should send event information.

  • For example, to determine when an OK button is pressed, you first create a class that implements an action listener interface. Next, you create an object of that class type. Finally, you add that object as a listener to the OK button's list of listeners.

  • You can also use adapter classes in conjunction with listeners in the JDK 1.1 event model. To catch events that use adapters, you create a separate class and an object of that class to listen for events. This class is designed to call methods on another object when events occur. So, when using adapters, an intermediate object is used to catch events and pass them on to some other object.

  • Let's take a more detailed look at both listers and adapters.

Additional Resources:

Exercise Eight
Table of Contents
Beans Event Listeners


Up to => Home / Authoring / Scripting / Tutorial




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers