I have this code to get all the elements I need and do some processing. The problem is I need to specify every panel I have to get the elements inside it.
fo
for (Component c : mainPanel.getComponents()) {
for (Component sc : ((JPanel) c).getComponents()) {
if (sc instanceof JTextField) {
//process
}
}
}
in my code, im just getting all instances of jtextfield. u can use same logic. this is just example of getting all sub-components from components you have taken. Hope it will help u out.