show JavaFX Error Message - Java JavaFX

Java examples for JavaFX:Dialog

Description

show JavaFX Error Message

Demo Code


import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;
import java.io.PrintWriter;
import java.io.StringWriter;

public class Main{
    public static void showErrorMessage(String message) {
        Alert alert = new Alert(AlertType.ERROR);
        alert.setTitle("DevLaunch Dialog");
        alert.setHeaderText("An error has been encountered");
        alert.setContentText(message);//from   www  .  ja va  2 s  .com

        alert.showAndWait();
    }
}

Related Tutorials