JavaFX Strange behaviour with progress indicator

I'm doing a login screen and I want to show a progress indicator while I do the user authentication process. I'm doing something like this.

// Handler for Button[fx:id="login"] onAction
public void handleLogin(ActionEvent event) {
    // Show loading indicator
    showLoadingImg();

    // User authentication
    String userName = user.getText();
    String password = psw.getText();

    OrdLogin ord = new OrdLogin();
    ord.setUserName(userName);
    ord.setPassword(password);
    ord.run();

    Authentication auth = orden.getInfoAutenticacion();
    if(auth == null){
        // Remove the loading indicator
        contProgress.getChildren().remove(1);

        // Show an error message
        msgError.setText("Incorrect password/user");
        msgError.setPrefHeight(Region.USE_COMPUTED_SIZE);
    } else {
        // login successful!
                    ...
    }
}

private void showLoadingImg() {     
    // Show loading indicator
    ProgressIndicator progress = new ProgressIndicator();
    contProgress.getChildren().add(progress);
}

If I run showLoadingImg() in my initialize method, the indicator is displayed correctly, but when I do showLoadingImg() inside handleLogin the indicator is not displayed. Any clues?


ANSWERS:


If auth is null then the progress indicator is being removed from the contProgress container. Have you debugged through the software to see if this is happening?



 MORE:


 ? JavaFX Strange behaviour with progress indicator
 ? JavaFX Strange behaviour with progress indicator
 ? Multithreading in JavaFX hangs the UI
 ? JavaFx Progress cannot be to solve a variable
 ? MVC with javaFX
 ? How to show a progress bar while downloading in javafx
 ? JavaFX Change text under Progress Indicator (default: Done)
 ? JavaFX Change text under Progress Indicator (default: Done)
 ? JavaFX Change text under Progress Indicator (default: Done)
 ? Change JavaFX progress bar style