Skip to content

Commit d6932af

Browse files
committed
set WrapText for some Text in ShowOutput, GetInput
1 parent 3ab4689 commit d6932af

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/java/view/gui/GetInput.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static Boolean getTwoChoiceAnswer(String question, String trueOption, Str
3838

3939
BorderPane borderPane = new BorderPane();
4040
Text text = new Text(question);
41+
text.setWrappingWidth(350);
4142
text.setFont(new Font("Bold", 14));
4243
text.setStyle("-fx-fill: white");
4344
HBox hBox = new HBox(text);
@@ -67,7 +68,7 @@ public static Boolean getTwoChoiceAnswer(String question, String trueOption, Str
6768
hBox1.getChildren().addAll(yesButton, noButton);
6869
borderPane.setBottom(hBox1);
6970

70-
Scene scene = new Scene(borderPane, 350, 70);
71+
Scene scene = new Scene(borderPane, 400, 150);
7172
getYesOrNoAnswerPopupWindow.setScene(scene);
7273
getYesOrNoAnswerPopupWindow.setTitle("Duel");
7374
getYesOrNoAnswerPopupWindow.showAndWait();
@@ -83,6 +84,7 @@ public static String getStringAnswerPopupWindow(String title, String question) {
8384

8485
BorderPane borderPane = new BorderPane();
8586
Text text = new Text(question);
87+
text.setWrappingWidth(450);
8688
text.setFont(new Font("Bold", 14));
8789
text.setStyle("-fx-background-color: #0404e9; -fx-fill: white");
8890
TextField textField = new TextField(null);
@@ -111,7 +113,7 @@ public static String getStringAnswerPopupWindow(String title, String question) {
111113
hBox.setAlignment(Pos.CENTER);
112114
borderPane.setBottom(hBox);
113115

114-
getStringAnswerPopupWindow.setScene(new Scene(borderPane, 450, 250));
116+
getStringAnswerPopupWindow.setScene(new Scene(borderPane, 500, 300));
115117
getStringAnswerPopupWindow.setResizable(false);
116118
getStringAnswerPopupWindow.setTitle(title);
117119
getStringAnswerPopupWindow.showAndWait();

src/main/java/view/gui/ShowOutput.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static void showOutput(String title, String header) {
2222

2323
BorderPane borderPane = new BorderPane();
2424
Text text = new Text(header);
25+
text.setWrappingWidth(400);
2526
text.setFont(new Font("Arial", 14));
2627
text.setStyle("-fx-fill: white");
2728
HBox hBox = new HBox(text);
@@ -39,7 +40,7 @@ public static void showOutput(String title, String header) {
3940
bottomHBox.setAlignment(Pos.CENTER);
4041
borderPane.setBottom(bottomHBox);
4142

42-
showOutPutPopUpWindow.setScene(new Scene(borderPane, 400, 120));
43+
showOutPutPopUpWindow.setScene(new Scene(borderPane, 450, 150));
4344
showOutPutPopUpWindow.setTitle(title);
4445
showOutPutPopUpWindow.showAndWait();
4546
}

0 commit comments

Comments
 (0)