How can you get the index of a 2D array of JLabels with mouseclick listeners?
for (x = 0; x < 8; x++) {
for(y=0; y<8; y++){
jLabel[x][y]=new javax.swing.JLabel(blank);
jPanel1.add(jLabel[x][y]);
jLabel[x][y].addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabelMouseClicked(evt);
}
});
}
y=0;
}
private int jLabelMouseClicked(java.awt.event.MouseEvent evt) {
System.out.println("clicked");
}