show JavaFX Success Alert - Java JavaFX

Java examples for JavaFX:Alert

Description

show JavaFX Success Alert

Demo Code


import javafx.application.Platform;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;

public class Main{
    public static void main(String[] argv) throws Exception{
        String content = "java2s.com";
        showSuccessAlert(content);/*from   w  w w.j  ava2 s .  co m*/
    }
    public static void showSuccessAlert(String content)
{
    Platform.runLater(() -> {
        Alert a = new Alert(Alert.AlertType.INFORMATION, content, ButtonType.OK);
        a.show();
    });
}
}

Related Tutorials