title: display random pictures using java
body: <p>I am trying to display random pictures based on Random() method's generation(just trying something like captcha). I am generating random no from an array, but dont know how to map these no's with images. Any ideas ? What I've done till now:</p>
  
  <p>import java.util.Arrays;
  import java.util.Random;</p>
  
  <p>public class Gen_Captcha {</p>
  
  <pre><code>static String[] myCaptchaLetters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"};
  Gen_Captcha captcha= new Gen_Captcha();
  public static void main(String[] args) {
      Random randomGenerator = new Random();
      for(int i=0;i&lt;5;i++){
          int random = randomGenerator.nextInt(62);
          System.out.print((myCaptchaLetters[random]));       
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>}</p>
  
  <p>Note: The above code does not include the swing framework code to display image.</p>