Basic HTML version of Foils prepared May 12 1996

Foil 104 Double Buffering to Reduce Flicker - II

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


1 The previous statements could be in init() while in paint(), one will construct applet image in offscreenGraphics as opposed to the argument g of paint(). So one would see statements such as:
2 e.g. offscreenGraphics.drawImage(img,10,10,this);
3 Finally at end of paint(), one could transfer the double buffered image to g by
4 g.drawImage(offscreenImage,0,0,this);
5 One would also need to override the update() method by
6 public void update(Graphics g) {
7 paint(g);
8 }

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