Basic HTML version of Foils prepared 18 May 97

Foil 24 Flickering in Applets and its Solution

From Java Tutorial - Spring 1997 Part 3:Graphics and the Abstract Windowing Toolkit Peking Tutorial, Web Certificate -- Spring-Summer 1997. by Nancy J. McCracken,Geoffrey C. Fox


1 Unless you are careful, dynamic applets will give flickering screens
2 This is due to cycle
3 paint(g)
4 update(g) clearing screen
5 paint(g) drawing new screen .....
6 where flicker caused by rapid clear-paint cycle.
7 There are two ways to solve this problem which involve changing update in different ways
  • 1: Change update() either not to clear screen at all (because you know paint() will write over parts that are to be changed) or to just clear the parts of the screen that are changed
  • or 2:Double Buffering

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 Thu Jan 8 1998