I have the following for loop:
for (int i=0; i<5; i++){
if (someVariable==anotherVariable)
jPanel(i).remove(anElement);
}
I would like to use the for loop to iterate through the JPanels I have, and remove a certain elements from all of them, my jPanels are named jPanel0, jPanel1,jPanel2....jPanel5
I know the above code doesn't work and I have no idea how to do it. Any help would be appreciated