I'm trying to create Dialogs using this code with controls FX:
// Show the error message.
Dialogs.create()
.title("Invalid Fields")
.masthead("Please correct invalid fields")
.message(errorMessage)
.showError();
But not works. Later i read that controls FX not work with Java FX 2.X, so i found javafx.scene.control.Alert
so i used this code:
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText("Look, an Information Dialog");
alert.setContentText("I have a great message for you!");
alert.showAndWait();
But still not working. I tried to import manually javafx.scene.control.*
and throws the error:
Caused by: java.lang.Error: Unresolved compilation problems:
Alert cannot be resolved to a type
Alert cannot be resolved to a type
AlertType cannot be resolved to a variable
what im doing wrong? how can i show an dialog/alert message? Regards.