Java Events

Whenever you move your mouse over the Applet area or maybe click a button in your applet (you will learn about buttons later), you create what is called an event.
 
    • An event is simply the denotation that some particular thing has occurred.... like a button being pressed.
    • Event Handling  is the process of responding to events as they happen.



 
 
 
 
 
 
Event Handling for non-GUI components:  Mouse, Keys, etc.


Java 1.1.*

 
 

Examples

your browser may not support all of these examples

Drawing Lines with Mouse Input

Key Input

 

Event Handling for  GUI components:  Button, Checkbox, etc.
 
Java 1.1.*

 

Examples

 
 
 
 
Responding to Buttons - ActionListner