public class SlideShow
{
  /////fields/////////
  
  private Picture[] pictureArray;
  private int waitTime = 2000; // 5 seconds
  
  ////////////constructors/////////////
  public SlideShow(Picture[]pictArray)
  {
    System.out.println(this.pictureArray);
    this.pictureArray = pictArray;
     System.out.println(this.pictureArray);
     }  
  
  public SlideShow() {}
    
    //////methods///////   //loop through array of pictures
   public void show () throws Exception
   {
  //loop through array of pictures   
  for (Picture pict : this.pictureArray)
  { 
  
          //show the picture
      pict.show();
      
      //wait for the wait time
      Thread.sleep(this.waitTime);
      
      //hide this picture
      pict.hide();
    }
  }
  
    
    public static void main(String[] args) throws Exception 
      {
 
   //SlideShow showObj = new SlideShow();
   
   //System.out.println(showObj);
      //SlideShow showObj= new SlideShow();
  Picture[] pictArray = new Picture[5];
pictArray[0] = new Picture(FileChooser.getMediaPath("Jaz02.jpg"));
pictArray[1] = new Picture(FileChooser.getMediaPath("JB and Jaz1.jpg"));
pictArray[2] = new Picture(FileChooser.getMediaPath("Jordy1.jpg"));
pictArray[3] = new Picture(FileChooser.getMediaPath("JB.jpg"));
pictArray[4] = new Picture(FileChooser.getMediaPath("JB5.jpg"));
SlideShow vacShow = new SlideShow(pictArray);
System.out.println(vacShow);
vacShow.show();
  }
 
  public String toString()
   {
   int numPicts = 0;
   if (this.pictureArray !=null)
    numPicts= pictureArray.length;
     return "A slide show with"+
       numPicts + "pictures and"+
     "a wait time of" +this.waitTime;
     
  

  }
  
 
}  //end of class put methods before this
