Possible Duplicate:
Dynamic variable names Java
I'm creating a Sudoku solver / generator in Java. I'm using NetBeans as the IDE. I created an applet and designed it in the NetBeans GUI designer. For the fields (that hold numbers in a 9*9 matrix) i used text fields and i named the variables according to their position in the matrix. For instance, the first one is num_1_1. The first number represents the row and the second one represents the column.
The actual generator / solver will work with a 2 dimensional integer array (int[][]) and when it generates / solves a sudoku it will populate the text vields in the gui with the numbers from the array.
Now, is there a way where i can use say a for loop to loop trough the veriable names and assign each one that way? Something like:
for(int x = 0; x < 9; x++){
for(int y = 0; y < 9; y++){
num+"_"+x+"_"+y = 5;
}
}
Thanks!