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

Foil 16 Some Basic Methods for Applets -- II

From Jan 29 Delivered Lecture for Course CPS616 -- Java Lecture 3 -- Exceptions Through Events CPS616 spring 1997 -- Jan 29 1997. by Nancy McCracken * See also color IMAGE
Secs 40.3
public void paint(Graphics g) actually has an argument and draws what you want on the screen
There is somewhat confusing other methods update() and repaint() which need to used in advanced applications. You may need to call repaint() in a dynamic applet to change display but update() would not need to be called as invoked by repaint(). However update() is sometimes best overridden
public void repaint() is a request by you to the Java runtime to update screen
public void update(Graphics g) is invoked by repaint() and performs the screen update which involves clearing screen and invoking paint()


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