16.8. Animating Images

An exciting application for threads is animation of images. Many Web pages contain animated GIF files (GIF89A) that cycle through a sequence of images. Typically, these animated GIF files are created with graphical packages like Adobe PhotoShop and Quark, which permit selection of a sequence of equal-sized images to combine into a single GIF file. When loaded into a browser, each subimage in the GIF sequence is presented to the user in a time-sliced fashion. The Java programming language provides better control over animated GIF89A files because the sequence of images can be explicitly controlled, as can the timing interval between image updates. The basic concept for creating animated images is as follows:

  • Read the sequence ...

Get Core Web Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.