Skip to content

Commit

Permalink
Merge pull request #375 from Advanced-Programming-2021/gui
Browse files Browse the repository at this point in the history
changed AlertBox style
  • Loading branch information
kysre authored Jul 9, 2021
2 parents 5dd33f7 + 69c2bd3 commit 4497bbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/view/gui/DuelMenuGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/view/gui/ShowOutput.java
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
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;
import javafx.scene.text.Font;
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;

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();
}
Expand Down

0 comments on commit 4497bbc

Please sign in to comment.