1

a small extract from my code below. I want to wait until the jfxsnackbar has shown the message before closing the window. Currently it just closes it too fast without showing the message.

boolean userCreated = true;
JFXSnackbar snackbar = new JFXSnackbar(rootPane);

if (userCreated) {
    snackbar.show("User record created", 2000);
    Stage stage = (Stage) firstnameText.getScene().getWindow();
    stage.close();
}

Your help will be much appreciated!

Regards Louw

  • I forgot to mention ... I tried Thread.sleep ... which waits but it also halts the snackbar display that still does not show. – Louw Pieters Jan 01 '19 at 07:38

0 Answers0