From d6932af7732d3fc4a40bc2bf4d6ad13e804963db Mon Sep 17 00:00:00 2001 From: Kasra Date: Fri, 9 Jul 2021 15:12:52 +0430 Subject: [PATCH] set WrapText for some Text in ShowOutput, GetInput --- src/main/java/view/gui/GetInput.java | 6 ++++-- src/main/java/view/gui/ShowOutput.java | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/view/gui/GetInput.java b/src/main/java/view/gui/GetInput.java index b71ebb19..bc05f0ce 100644 --- a/src/main/java/view/gui/GetInput.java +++ b/src/main/java/view/gui/GetInput.java @@ -38,6 +38,7 @@ public static Boolean getTwoChoiceAnswer(String question, String trueOption, Str BorderPane borderPane = new BorderPane(); Text text = new Text(question); + text.setWrappingWidth(350); text.setFont(new Font("Bold", 14)); text.setStyle("-fx-fill: white"); HBox hBox = new HBox(text); @@ -67,7 +68,7 @@ public static Boolean getTwoChoiceAnswer(String question, String trueOption, Str hBox1.getChildren().addAll(yesButton, noButton); borderPane.setBottom(hBox1); - Scene scene = new Scene(borderPane, 350, 70); + Scene scene = new Scene(borderPane, 400, 150); getYesOrNoAnswerPopupWindow.setScene(scene); getYesOrNoAnswerPopupWindow.setTitle("Duel"); getYesOrNoAnswerPopupWindow.showAndWait(); @@ -83,6 +84,7 @@ public static String getStringAnswerPopupWindow(String title, String question) { BorderPane borderPane = new BorderPane(); Text text = new Text(question); + text.setWrappingWidth(450); text.setFont(new Font("Bold", 14)); text.setStyle("-fx-background-color: #0404e9; -fx-fill: white"); TextField textField = new TextField(null); @@ -111,7 +113,7 @@ public static String getStringAnswerPopupWindow(String title, String question) { hBox.setAlignment(Pos.CENTER); borderPane.setBottom(hBox); - getStringAnswerPopupWindow.setScene(new Scene(borderPane, 450, 250)); + getStringAnswerPopupWindow.setScene(new Scene(borderPane, 500, 300)); getStringAnswerPopupWindow.setResizable(false); getStringAnswerPopupWindow.setTitle(title); getStringAnswerPopupWindow.showAndWait(); diff --git a/src/main/java/view/gui/ShowOutput.java b/src/main/java/view/gui/ShowOutput.java index 553d283d..1200bd9e 100644 --- a/src/main/java/view/gui/ShowOutput.java +++ b/src/main/java/view/gui/ShowOutput.java @@ -22,6 +22,7 @@ public static void showOutput(String title, String header) { BorderPane borderPane = new BorderPane(); Text text = new Text(header); + text.setWrappingWidth(400); text.setFont(new Font("Arial", 14)); text.setStyle("-fx-fill: white"); HBox hBox = new HBox(text); @@ -39,7 +40,7 @@ public static void showOutput(String title, String header) { bottomHBox.setAlignment(Pos.CENTER); borderPane.setBottom(bottomHBox); - showOutPutPopUpWindow.setScene(new Scene(borderPane, 400, 120)); + showOutPutPopUpWindow.setScene(new Scene(borderPane, 450, 150)); showOutPutPopUpWindow.setTitle(title); showOutPutPopUpWindow.showAndWait(); }