Source code:
applet_noDoubleBuffering.java
and
applet_doubleBuffering.java