Animated GIFS

The AWT contains built-in support for animated GIFs; simply create a java.awt.Image with an animated GIF in the manner described above, and it will animate on its own. Figure 5-3 shows the frames of an animated GIF displayed by the application listed in Example 5-8.

Figure 5-3. An Animated GIF. The globe animated GIF contains 10 frames, which are displayed from left to right and top to bottom.

Example 5-8. An Application That Displays an Animated GIF
 import java.awt.*; import java.awt.event.*; public class Globe extends Frame { Image ...

Get Graphic Java™ 1.2, Volume I: AWT, Third 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.