show JavaFX Information Dialog - Java JavaFX

Java examples for JavaFX:Dialog

Description

show JavaFX Information Dialog

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 showInformationDialog(String message) {
        Alert alert = new Alert(AlertType.INFORMATION);
        alert.setTitle("DevLaunch Dialog");
        alert.setHeaderText("Information");
        alert.setContentText(message);/*from   www  .j av  a  2  s .  c om*/

        alert.showAndWait();
    }
}

Related Tutorials