//File: FlipBook.java import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.applet.*; public class FlipBook{ //Data Structures private Image [] image_g; public Graphics [] g; public int curWidth=0, curHeight=0, curFrames=0; private Graphics graphics; private Applet applet; // Constructor public FlipBook( Graphics g_real, int width, int height, Applet a, int frames) { int i; image_g = new Image[frames]; g = new Graphics[frames]; for (i = 0 ; i < frames; i++ ){ image_g[i] = a.createImage(width, height); g[i] = (image_g[i]).getGraphics(); } graphics = g_real; applet = a; curWidth = width; curHeight = height; curFrames = frames; } // Put out the buffered image public void ShowPage(ImageObserver observer, int frame) { (applet.getGraphics()).drawImage(image_g[frame],0,0,observer); } }