eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
Resources
 ::   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
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.

Previous Page | Next Page