eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
 ::   Tutorials
 ::   Presentations
Perl & CGI tutorials
 ::   Intro to Perl/CGI and HTML Forms
 ::   Intro to Windows Perl
 ::   Intro to Perl 5
 ::   Intro to Perl
 ::   Intro to Perl Taint mode
 ::   Sherlock Holmes and the Case of the Broken CGI Script
 ::   Writing COM Components in Perl

Java tutorials
 ::   Intro to Java
 ::   Cross Browser Java

Misc technical tutorials
 ::   Intro to The Web Application Development Environment
 ::   Introduction to XML
 ::   Intro to Web Design
 ::   Intro to Web Security
 ::   Databases for Web Developers
 ::   UNIX for Web Developers
 ::   Intro to Adobe Photoshop
 ::   Web Programming 101
 ::   Introduction to Microsoft DNA

Misc non-technical tutorials
 ::   Misc Technopreneurship Docs
 ::   What is a Webmaster?
 ::   What is the open source business model?
 ::   Technical writing
 ::   Small and mid-sized businesses on the Web

Offsite tutorials
 ::   ISAPI Perl Primer
 ::   Serving up web server basics
 ::   Introduction to Java (Parts 1 and 2) in Slovak


Introduction to Web Programming
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 listenerobject implements a listener interface and tells the object it wants to listen to that that object 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.

Previous Page |Next Page