How can I display jpg image which I stored in arraylist in JPanel? Im not able to display the jpg files in the JPanel.
String[] pictureFile = {"A.jpg","B.jpg","C.jpg"};
List<String> 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);