Skip to content

Commit 4497bbc

Browse files
authored
Merge pull request #375 from Advanced-Programming-2021/gui
changed AlertBox style
2 parents 5dd33f7 + 69c2bd3 commit 4497bbc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/main/java/view/gui/DuelMenuGui.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ public void exitToMainMenu() {
797797
pausePopupWindow.close();
798798
MusicPlayer.muteDuelMenuMusic();
799799
MainMenuGui mainMenuGui = new MainMenuGui();
800-
mainMenuGui.setUsername(username);
800+
MainMenuGui.setUsername(username);
801801
MusicPlayer.unMuteMainMenu();
802802
try {
803803
mainMenuGui.start(stage);

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
package view.gui;
22

3+
import javafx.geometry.Insets;
34
import javafx.geometry.Pos;
45
import javafx.scene.Scene;
5-
import javafx.scene.control.Alert;
66
import javafx.scene.control.Button;
77
import javafx.scene.layout.BorderPane;
88
import javafx.scene.layout.HBox;
99
import javafx.scene.text.Font;
1010
import javafx.scene.text.Text;
1111
import javafx.stage.Modality;
1212
import javafx.stage.Stage;
13-
import org.xml.sax.HandlerBase;
13+
import view.gui.elements.GetImage;
1414

1515
public class ShowOutput {
1616
private static Stage showOutPutPopUpWindow;
1717

1818
public static void showOutput(String title, String header) {
1919
showOutPutPopUpWindow = new Stage();
2020
showOutPutPopUpWindow.initModality(Modality.APPLICATION_MODAL);
21+
showOutPutPopUpWindow.getIcons().add(GetImage.getGameIcon());
2122

2223
BorderPane borderPane = new BorderPane();
2324
Text text = new Text(header);
2425
text.setFont(new Font("Arial", 14));
2526
text.setStyle("-fx-fill: white");
2627
HBox hBox = new HBox(text);
28+
hBox.setPadding(new Insets(5));
2729
hBox.setStyle("-fx-background-color: #0303a4");
28-
hBox.setAlignment(Pos.BASELINE_LEFT);
30+
hBox.setAlignment(Pos.CENTER);
2931
borderPane.setCenter(hBox);
3032

3133
Button okButton = new Button("ok");
3234
okButton.setStyle("-fx-background-color: orange");
3335
okButton.setOnMouseClicked(e -> showOutPutPopUpWindow.close());
3436
HBox bottomHBox = new HBox(okButton);
37+
bottomHBox.setPadding(new Insets(15));
3538
bottomHBox.setStyle("-fx-background-color: #0303a4");
3639
bottomHBox.setAlignment(Pos.CENTER);
3740
borderPane.setBottom(bottomHBox);
3841

39-
showOutPutPopUpWindow.setScene(new Scene(borderPane, 350, 90));
42+
showOutPutPopUpWindow.setScene(new Scene(borderPane, 400, 120));
4043
showOutPutPopUpWindow.setTitle(title);
4144
showOutPutPopUpWindow.showAndWait();
4245
}

0 commit comments

Comments
 (0)