Basic HTML version of Foils prepared Sept 21 1998

Foil 35 The Event Classes

From Java Tutorial 98- 3: Graphics and the Abstract Windowing Toolkit NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken

API for class Event
1 Every event has a source object, obtained by getSource(), and a type value, obtained by getID(). In the case of buttons, the ID is ACTION_PERFORMED. Other Events may have more than one type of event ID.
2 Event subclasses also have methods for whatever data is needed to handle the event. For example, ActionEvent has a method paramString() which for buttons, returns the string labelling the button. MouseEvent has methods getX() and getY(), which return the x and y pixel location of the mouse, and getClickCount().
3 AWTEvent
4 ActionEvent
5 InputEvent
6 Adjustment
7 Event
8 ItemEvent
9 ComponentEvent
10 MouseEvent
11 KeyEvent
12 . . .

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998