Basic HTML version of Foils prepared 18 May 97

Foil 46 Actions associated with Components in AWT - I

From Java Tutorial - Spring 1997 Part 3:Graphics and the Abstract Windowing Toolkit Peking Tutorial, Web Certificate -- Spring-Summer 1997. by Nancy J. McCracken,Geoffrey C. Fox


1 We already discussed handling Mouse and Keyboard Events. These AWT components come with new actions which need to be handled with an action() method in your applet
2 Put action ( a method of class Component) in Container instance that is at lowest possible level so you can customize action to things in that Container
3 action(Event evt, Object arg)'s are looked for in same fashion as exceptions. Scan up Containers looking for a method of this name. Scanning stops when you find an action and that method returns true
4 evt.target holds the object that caused the Event
5 Object Arg returned depends on particular Component invoked
6 There are further evt.id's associated with the various peculiar Components -- see description of class Event for current detailed description.

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 Thu Jan 8 1998