build JavaFX Simple Dialog - Java JavaFX

Java examples for JavaFX:Dialog

Description

build JavaFX Simple Dialog

Demo Code


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

public class Main{
    public static Alert buildSimpleDialog(String title, String header,
            String body, AlertType type) {
        Alert alert = new Alert(type);
        alert.setTitle(title);/* ww w  .  j  a  v  a  2 s  .  c o  m*/
        alert.setHeaderText(header);
        alert.setContentText(body);

        return alert;
    }
}

Related Tutorials