最佳答案
使用 Alert
:
Alert errorAlert = new Alert(AlertType.ERROR);
errorAlert.setHeaderText("Input not valid");
errorAlert.setContentText("The size of First Name must be between 2 and 25 characters");
errorAlert.showAndWait();
关于javafx - 如何在 JavaFX 中执行错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39149242/