change all the label icon in a panel
- by Josh
I have a panel with several JLabel, I would like to change all their Icon,
String path = System.getProperty("user.dir");
for (int x=0;x< 21;x++) {
javax.swing.JLabel lab = boardPanel.getComponent(x).;
lab.setIcon(new ImageIcon(path + "\\image\\blank.jpg"));
}
it gives me an error of incompatible type, all inside the boardPanel are JLabel,
im using netbeans 6.8.