The line:
image = createImage(source);
should read:
image = Toolkit.getDefaultToolkit().createImage(source);
The example code provided in the JavaDoc is imcomplete. This is probably
because the author just pulled it out of some
larger example without properly referencing the example (it mentions "adapted
from the MemoryAnimationSourceDemo by
Garth Dickie" but that doesn't mean much to me).