title: Displaying jpg image on JPanel
body: <p>How can I display jpg image which I stored in arraylist in JPanel?
  Im not able to display the jpg files in the JPanel.</p>
  
  <pre><code>String[] pictureFile   = {"A.jpg","B.jpg","C.jpg"};
  List&lt;String&gt;  picList1 = Arrays.asList(pictureFile);
  
  Collections.shuffle(picList1); 
  
  ImageIcon icon = new ImageIcon("picList1.get(0)");
  JLabel label1   = new JLabel();
  label1.setIcon(icon);
  
  JPanel panel = newJPanel;
  panel.add(label); 
  </code></pre>