Basic HTML version of Foils prepared May 12 1996

Foil 86 Some Basic Methods for Applets -- II

From CRPC Lectures on Java Language Applets Graphics CRPC Annual Meeting Tutorial -- May 14,1996. by Geoffrey C. Fox


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 Dec 14 1997