CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Alert Dialog

Java quiz · Question 64
mediumJavaFX

What does this code do when the button is clicked?

Code

1Button deleteBtn = new Button("Delete");
2 
3deleteBtn.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});