HELP! * GREY=local LOCAL HTML version of Foils prepared July 10 1996

Foil 100 Some Basic Methods for Applets -- II

From Basic Lectures on Java Language Applets Graphics Networking Trip to China and Icase Tutorial -- July 12-28 and June 10-13 96. by Geoffrey C. Fox * See also color IMAGE

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 Tue Feb 18 1997