Hello!
I'm having trouble to loop through all the components of a JFrame. The program is going to be a Sudoku-solver, which means that I have 9 rows and 9 columns of JTextFields. Each textfield is in one of 9 JPanels and each JPanel is in one big JPanel. Now I want to loop through every textfield, and my code is shown below:
Component[] c = p.getComponents(); for (int i = 0; i < c.length; i++) { Component[] c2 = c[i].getComponents(); for (int 0 = 1; j < c2.length; j++) { } }
The big JPanel is p, and what I want is to loop through each component in p, and each component in the components of p. I'm getting an error:
"Cannot find symbol
Symbol: method getComponents()
Location: Class Components"
Can someone tell me what I'm doing wrong.
Hank