← Back to Question List
Java Quiz #64
Alert Dialog
What does this code do when the button is clicked?
📄 Code
1Button deleteBtn = new Button("Delete");23deleteBtn.setOnAction(e -> {4 Alert alert = new Alert(Alert.AlertType.CONFIRMATION);5 alert.setTitle("Confirm Delete");6 alert.setHeaderText("Are you sure?");7 alert.setContentText("This action cannot be undone.");8 alert.showAndWait();9});