seguinte
ImageIcon[] icon= null;
JLabel[] labels = new JLabel[2];
icon[0] = new ImageIcon("MS.GIF");
icon[1] = new ImageIcon("tomcat.gif");
for(int i = 0; i < labels.length; i++) {
labels[i] = new JLabel(icone);
labels[i].setIcon(icone);
return labels[i];
}
porem aqui
icon[0] = new ImageIcon(“MS.GIF”);
icon[1] = new ImageIcon(“tomcat.gif”);
trava todo o programa ele nao coloca no array as image se eu fizer assim
ImageIcon icone=null;
icone = new ImageIcon(“tomcat.gif”);
no lugar do array funciona mas quero setar para cada jlabel uma imagem