From: rnayabed Date: Wed, 30 Dec 2020 18:46:41 +0530 Subject: Refactored Alert --- Refactored Alert --- --- 'a/src/main/java/com/StreamPi/Util/Alert/StreamPiAlert.java' +++ b/src/main/java/com/StreamPi/Util/Alert/StreamPiAlert.java @@ -70,17 +70,18 @@ public class StreamPiAlert { public StreamPiAlert(String title, String contentText) { - Label label = new Label(contentText); - label.setWrapText(true); - - VBox vBox = new VBox(label); - - set(title, StreamPiAlertType.INFORMATION, vBox, new String[]{ "OK" }); + this(title, contentText, StreamPiAlertType.INFORMATION); + } + + public StreamPiAlert(String contentText, StreamPiAlertType alertType) + { + this("Alert", contentText, alertType); } + public StreamPiAlert(String title, StreamPiAlertType streamPiAlertType, String... buttons) { - set(title, streamPiAlertType, null, new String[]{ "OK" }); + set(title, streamPiAlertType, null, buttons); }