0
如何显示我存储在JPanel的arraylist中的jpg图像?我不能在JPanel中显示jpg文件。在JPanel上显示jpg图像
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);
谢谢...它的工作:-) – Jessy 2009-11-01 17:47:42