HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 4 February 97

Foil 5 Structure of the java.awt GUI Components - II

From Feb 3 Delivered Lecture for Course CPS616 -- Java Lecture 4 -- AWT Through I/O CPS616 spring 1997 -- Feb 3 1997. by Nancy McCracken * See also color IMAGE
Secs 149.7
In the simplest use of AWT, one could add a Button to an Applet (grandchild of Container) using in the init() method for Applet
  • Button b = new Button("Are You Feeling well");
  • add(b); // add() is a Container method
The various added Components are put in the panel by the LayoutManager using order in which they were added
A Final critical part of the AWT is the actions generated by these components which are processed by overriding the action() method in Component
  • action(Event e, Object Anyargemightliketoreturn);
We define extra events -- such as those connected with scrolling or selecting buttons to those of basic mouse/keyboard


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 Sun Feb 16 1997