Loading JPEG or GIF Animation Frames into an Array

		// Load animation image frames
		m_frame = new Image[m_numImages];
		String sImageFile;
		int nImageNum;
		for (int i = 0; i < m_numImages; i++)
		{
			nImageNum = i + 1;
			sImageFile = m_imageFile + ((nImageNum < 10)? "000":"00") + nImageNum + ".jpg";
			m_frame[i] = getImage(getDocumentBase(), sImageFile);

			// add this frame to the mediatracker
			m_mediaTracker.addImage(m_frame[i], 0);
		}

Learn More

The complete applet source code.