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


Event Types

  • In the previous section, we showed how to subclass a button and handle an action event. Buttons post action events when they are pressed and the event ID for an action event is ACTION_EVENT. So, in our handleEvent() routine, we checked for an event id of ACTION_EVENT to determine if the event passed to the handleEvent() routine was an action event:

    if (event.id == Event.ACTION_EVENT)
        System.out.println("I got an action: " + event);
    

  • However, action events are only one type of event. There are many more. The following table outlines some of the more important

Event ID Called When
ACTION_EVENT An action occurs.
GOT_FOCUS A component gained focus.
KEY_PRESS A key is pressed.
KEY_RELEASE A key is released.
LIST_DESELECT An item is deselected.
LIST_SELECT An item is selected.
LOST_FOCUS A component loses focus.
MOUSE_DOWN A mouse button is pressed.
MOUSE_DRAG The mouse is moved while it is pressed.
MOUSE_ENTER The mouse enters a component.
MOUSE_EXIT The mouse exists a component.
MOUSE_MOVE The mouse is moved.
MOUSE_UP The mouse button is released.
SCROLL_ABSOLUTE The thumb in a scrolling component is moved
SCROLL_LINE_DOWN A line down in a scrolling component is activated.
SCROLL_LINE_UP A line up in a scrolling component is activated.
SCROLL_PAGE_DOWN A page down in a scrolling component is activated.
SCROLL_PAGE_UP A page up in a scrolling component is activated.
WINDOW_DEICONIFY A window is de-iconified.
WINDOW_DESTROY A window is destroyed (closed).
WINDOW_EXPOSE A window is exposed (displayed).
WINDOW_ICONIFY A window is iconified.
WINDOW_MOVED A window is moved.

Additional Resources:

JDK 1.0 Event Handling
Table of Contents
Other Methods for Handling Events


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