title: draw image in applet
body: <p>i having problem with draw image in applet. i want to display all images one by one in applet but it shows only last image of the folder my code is given below.</p>
  
  <pre><code>public class ImageInSwingTest extends JApplet
  {
      String filePath="C:\\Users\\yogi\\Pictures\\pictures"; //all .png files more than 200 files
      String files;
      File folder=new File(filePath);
      File[] listOfFiles;
      Image m;
  
      @Override
      public void init()
      {
          listOfFiles=folder.listFiles();
          for(int i=0;i&lt;listOfFiles.length;i++)
          {
              if(listOfFiles[i].isFile())
              {
                  files=listOfFiles[i].getName();
                  if(files.endsWith(".png"))
                  {
                      String filepath=listOfFiles[i].getAbsolutePath();
                      System.out.println(filepath);
                      try {
                           m = ImageIO.read(new File(filepath));
                          paint(ImageInSwingTest.this.getGraphics());
  
                      } catch (IOException ex) {
                          Logger.getLogger(ImageInSwingTest.class.getName()).log(Level.SEVERE, null, ex);
                      }
                  }
              }
  
          }
      }
      public void paint(Graphics g)
      {
          g.drawImage(m, 0, 0, this);
  
      }
  
  }
  </code></pre>
  
  <p>so, please can any one tell me how can i display all images one by one.?
  Thanks.</p>