Skip to content

Commit

Permalink
set WrapText for some Text in ShowOutput, GetInput
Browse files Browse the repository at this point in the history
  • Loading branch information
kysre committed Jul 9, 2021
1 parent 3ab4689 commit d6932af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/java/view/gui/GetInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/view/gui/ShowOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
}
Expand Down

0 comments on commit d6932af

Please sign in to comment.