title: Java, add image when there is a specific number
body: <p>Sorry for not being clear enough. English is my second language.</p>
  
  <p>I have done a complet code down here to generate four random numbers and then printing out four images (image two).</p>
  
  <p>I have image one, two, thre, four, five and six.</p>
  
  <pre><code>Random tarning = new Random();
  
  String strOutput="";
  int nummer;
  
  
  for(int i=1; i&lt;=4; i++){
     nummer = 1+tarning.nextInt(6);
     strOutput=strOutput+" "+nummer;
  }
  
  lblOutput.setText(strOutput);
  
  
  jPanel2.setLayout(new java.awt.GridLayout(1,6));          
  for(int n=0;n&lt;=3;n++){
     x[n].setIcon(new ImageIcon("two.png")); 
     jPanel2.add(x[n]);
     jPanel2.revalidate();
     jPanel2.repaint();
   }
  </code></pre>
  
  <p>When it prints out like 1 2 3 4, How can i get image One to print when number one comes and then image two when number two comes etc.</p>