From 69c2bd3146663598e01260f09565a05ef12c1942 Mon Sep 17 00:00:00 2001 From: Kasra Date: Fri, 9 Jul 2021 13:39:01 +0430 Subject: [PATCH] changed AlertBox style --- src/main/java/view/gui/DuelMenuGui.java | 2 +- src/main/java/view/gui/ShowOutput.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/view/gui/DuelMenuGui.java b/src/main/java/view/gui/DuelMenuGui.java index 6210349b..5468abe3 100644 --- a/src/main/java/view/gui/DuelMenuGui.java +++ b/src/main/java/view/gui/DuelMenuGui.java @@ -797,7 +797,7 @@ public void exitToMainMenu() { pausePopupWindow.close(); MusicPlayer.muteDuelMenuMusic(); MainMenuGui mainMenuGui = new MainMenuGui(); - mainMenuGui.setUsername(username); + MainMenuGui.setUsername(username); MusicPlayer.unMuteMainMenu(); try { mainMenuGui.start(stage); diff --git a/src/main/java/view/gui/ShowOutput.java b/src/main/java/view/gui/ShowOutput.java index 82b9b48d..553d283d 100644 --- a/src/main/java/view/gui/ShowOutput.java +++ b/src/main/java/view/gui/ShowOutput.java @@ -1,8 +1,8 @@ package view.gui; +import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; -import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; @@ -10,7 +10,7 @@ import javafx.scene.text.Text; import javafx.stage.Modality; import javafx.stage.Stage; -import org.xml.sax.HandlerBase; +import view.gui.elements.GetImage; public class ShowOutput { private static Stage showOutPutPopUpWindow; @@ -18,25 +18,28 @@ public class ShowOutput { public static void showOutput(String title, String header) { showOutPutPopUpWindow = new Stage(); showOutPutPopUpWindow.initModality(Modality.APPLICATION_MODAL); + showOutPutPopUpWindow.getIcons().add(GetImage.getGameIcon()); BorderPane borderPane = new BorderPane(); Text text = new Text(header); text.setFont(new Font("Arial", 14)); text.setStyle("-fx-fill: white"); HBox hBox = new HBox(text); + hBox.setPadding(new Insets(5)); hBox.setStyle("-fx-background-color: #0303a4"); - hBox.setAlignment(Pos.BASELINE_LEFT); + hBox.setAlignment(Pos.CENTER); borderPane.setCenter(hBox); Button okButton = new Button("ok"); okButton.setStyle("-fx-background-color: orange"); okButton.setOnMouseClicked(e -> showOutPutPopUpWindow.close()); HBox bottomHBox = new HBox(okButton); + bottomHBox.setPadding(new Insets(15)); bottomHBox.setStyle("-fx-background-color: #0303a4"); bottomHBox.setAlignment(Pos.CENTER); borderPane.setBottom(bottomHBox); - showOutPutPopUpWindow.setScene(new Scene(borderPane, 350, 90)); + showOutPutPopUpWindow.setScene(new Scene(borderPane, 400, 120)); showOutPutPopUpWindow.setTitle(title); showOutPutPopUpWindow.showAndWait(); }