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


Events

Events

  • In this section, we examine how to make your programs respond to events. In the most basic terms, events occur when something happens. The most common events are caused by user interaction. For example, events occur when a user presses the mouse button, releases the mouse button, or presses a key on the keyboard.

  • Events are also generated without user involvement, such as when code programmatically selects items and generates an event.

  • After an event occurs, it's then up to your program to determine the appropriate response.

  • User-interface components can both listen for events such as key and mouse presses, and also generate events of their own. For example, a button listens for a mouse press and release that occurs over itself. When one occurs, the button posts its own event (an action event).

  • Dealing with events can be complicated because there are two different event models to choose from since the JDK changed the way events were handled between the JDK 1.0 and JDK 1.1 releases.

  • The JDK 1.0 release from Sun contains a very simple method of event handling. Events are sent to the component where they occur and then sent to that component's parents. You can simply subclass a component or one of the component's parents to implement a method to handle events.

  • The JDK 1.1 release introduced a new way to deal with events. In the 1.1 model, events are distributed using delegation. Objects register themselves as being interested in receiving events from other objects. The JDK 1.1 model uses listeners and adapters that allow you to separate user-interface and event-handling code. It also allows any object, not just a user-interface component, to receive events from a component.

Additional Resources:

Introduction to Web Programming
Table of Contents
How Events Originate


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, & Permissions, Privacy Policy.

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