SlideShow - /* * This class creates a sequence of images...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * This class creates a sequence of images and allows this sequence of images to be * displayed. */ import java.io.*; import java.awt.Color; i public class SlideShow { /**The slideshow is represented as an array of picture objects */ private Picture[] pictureObjects; /** * SlideShow object is created from a directory name consisting of images found * in that directory */ public SlideShow(String directoryName) { /** * Given the directory name retrieve the names of all file in the directory * indicated by the directory name; Technique is similar to Exercise 3, Lab 7. */ File directory = new File(directoryName); String[] files = directory.list(); /**Initialize the pictureObjects array as a sequence of pictures with a * picture for each file found in the directory */ pictureObjects = new Picture[files.length]; /** * For each file in the directory create a Picture object */ for (int i=0; i < files.length; i++) pictureObjects[i] = new Picture(directoryName+"/"+files[i]); } /** * SlideShow object is created from an array of Picture objects
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

SlideShow - /* * This class creates a sequence of images...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online