I was wondering if I can get some kind of control variable from an "% advanced"%. "
For example:
On a normal for, I do this as follows:
for (int i = 0; i < algumaCoisa.size() ou length; i++){
//código..
}
this variable for
I can use to go through the components, eg:
((JComponent) componentes.get(i)).requestFocus();
in an advanced for I would:
for(MeuComp comp: componentes){
//código..
}
How do I get the position that i
is and go through all components?
Note: for
is an interface that contains methods, which are implemented by components such as MeuComp
, JTexefield
, and so on. JComboBox
is a componentes
of these components, but I think it would not be that important, the example could be on top of anything.