Java examples for JavaFX:Alert
show JavaFX Success Alert
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(); }); } }