O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required