HELP! * GREY=local LOCAL HTML version of Foils prepared 29 January 1996

Foil 81 Flickering in Applets and its Solution

From CPS616 Lectures on Java CPS616 Basic Information Track for Computational Science -- Winter-Spring Semester 96. by Geoffrey C. Fox * See also color IMAGE

Unless you are careful, dynamic applets will give flickering screens
This is due to cycle
paint(g)
update(g) clearing screen
paint(g) drawing new screen .....
where flicker caused by rapid clear-paint cycle.
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



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