my problem is that inside the for where I start my JChekBox array I add the ChangeListener step, but inside this I do not know how to get the JChexBox index to get the text that is in it. example:
for(int x = 0; x < cbConvertirDe.length; x++){
cbConvertirDe[x] = new JCheckBox(elementos[x]);
cbConvertirDe[x].setBounds(264, posicionY, 200, 23);
cbConvertirDe[x].addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
etiquetaNumero.setText("NUMERO "+cbConvertirDe[].getText()); //dentro de los corchetes no se que poner, no puedo utilizar la 'x' del for
}
});
panel.add(cbConvertirDe[x]);
cbConvertirA[x] = new JCheckBox(elementos[x]);
cbConvertirA[x].setBounds(466, posicionY, 200, 23);
panel.add(cbConvertirA[x]);
grupo1.add(cbConvertirDe[x]);
grupo2.add(cbConvertirA[x]);
posicionY += 23;
}'