Hi, I am trying to write some code to insert coordinates which are taken from the mouseClick position and then added to a 2D array. The user should click 6 positions on a panel and these positions should be stored in a 2D array.
I hope you can help. Thank you!
public void mouseClicked(MouseEvent e) {
alignCoord = new int[10][10];
for (int i = 0; i < alignCoord.length; i++) {
for (int j = 0; j < alignCoord.length; j++) {
x = e.getX();
y = e.getY();
alignCoord[i][j]; <--- I know this is wrong but I'm not sure how to add the elements to the array
}
}