When you define it in this way:
@FXML private TextField profileNameField = new TextField();
the assigned value is never user and will be rewritten by FXMLLoader.
So the array is initialized with incorrect values, initialize it after profileNameField
is initialized by FXMLLoader, in the initialize
method (yep, I think, the English should be edited in this answer :) ):
public class <Controller name> implements javafx.fxml.Initializable { // necessary
...
private TextInputControl[] textControls;
@FXML private TextField profileNameField;
...
public void initialize(URL url, ResourceBundle resourceBundle) {
textControls = {
profileNameField,
...
};
...
}
...
}
see http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/introduction_to_fxml.html#controllers