The program says to change all my textfield and checkbox to "final" but, when I do, in another part of the code it tells me to remove "final", I'm confused.
the error at the beginning marks it here:
JButton btnCalcular = new JButton("Calcular");
btnCalcular.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// Si es Llamada Local
if (checkboxLocal.isSelected())
{
}
// Si es Llamada Provincial y Franja 1
else if (checkboxProvincial.isSelected() && checkboxFranja1.isSelected())
{
}
// Si es Llamada Provincial y Franja 2
else if (checkboxProvincial.isSelected() && checkboxFranja2.isSelected())
{
}
// Si es Llamada Provincial y Franja 3
else if (checkboxProvincial.isSelected() && checkboxFranja3.isSelected())
{
}
}
});
The error is:
Can not refer to the non-final local variable txtOrderNumber defined in an enclosing scope
This error appears in the following things:
txtNumeroOrigen.setText("");
txtNumeroDestino.setText("");
txtDuracion.setText("");
// Check Box
checkboxProvincial.setSelected(false);
checkboxProvincial.setEnabled(true);
checkboxLocal.setSelected(false);
checkboxLocal.setEnabled(true);
checkboxFranja1.setSelected(false);
checkboxFranja2.setSelected(false);
checkboxFranja3.setSelected(false);
checkboxFranja1.setEnabled(false);
checkboxFranja2.setEnabled(false);
checkboxFranja3.setEnabled(false);
What am I doing wrong ?, I am declaring things where it is not ?. He says to end it and after I remove it, I do not understand anything.