|
1 | 1 | package view.gui;
|
2 | 2 |
|
| 3 | +import javafx.geometry.Insets; |
3 | 4 | import javafx.geometry.Pos;
|
4 | 5 | import javafx.scene.Scene;
|
5 |
| -import javafx.scene.control.Alert; |
6 | 6 | import javafx.scene.control.Button;
|
7 | 7 | import javafx.scene.layout.BorderPane;
|
8 | 8 | import javafx.scene.layout.HBox;
|
9 | 9 | import javafx.scene.text.Font;
|
10 | 10 | import javafx.scene.text.Text;
|
11 | 11 | import javafx.stage.Modality;
|
12 | 12 | import javafx.stage.Stage;
|
13 |
| -import org.xml.sax.HandlerBase; |
| 13 | +import view.gui.elements.GetImage; |
14 | 14 |
|
15 | 15 | public class ShowOutput {
|
16 | 16 | private static Stage showOutPutPopUpWindow;
|
17 | 17 |
|
18 | 18 | public static void showOutput(String title, String header) {
|
19 | 19 | showOutPutPopUpWindow = new Stage();
|
20 | 20 | showOutPutPopUpWindow.initModality(Modality.APPLICATION_MODAL);
|
| 21 | + showOutPutPopUpWindow.getIcons().add(GetImage.getGameIcon()); |
21 | 22 |
|
22 | 23 | BorderPane borderPane = new BorderPane();
|
23 | 24 | Text text = new Text(header);
|
24 | 25 | text.setFont(new Font("Arial", 14));
|
25 | 26 | text.setStyle("-fx-fill: white");
|
26 | 27 | HBox hBox = new HBox(text);
|
| 28 | + hBox.setPadding(new Insets(5)); |
27 | 29 | hBox.setStyle("-fx-background-color: #0303a4");
|
28 |
| - hBox.setAlignment(Pos.BASELINE_LEFT); |
| 30 | + hBox.setAlignment(Pos.CENTER); |
29 | 31 | borderPane.setCenter(hBox);
|
30 | 32 |
|
31 | 33 | Button okButton = new Button("ok");
|
32 | 34 | okButton.setStyle("-fx-background-color: orange");
|
33 | 35 | okButton.setOnMouseClicked(e -> showOutPutPopUpWindow.close());
|
34 | 36 | HBox bottomHBox = new HBox(okButton);
|
| 37 | + bottomHBox.setPadding(new Insets(15)); |
35 | 38 | bottomHBox.setStyle("-fx-background-color: #0303a4");
|
36 | 39 | bottomHBox.setAlignment(Pos.CENTER);
|
37 | 40 | borderPane.setBottom(bottomHBox);
|
38 | 41 |
|
39 |
| - showOutPutPopUpWindow.setScene(new Scene(borderPane, 350, 90)); |
| 42 | + showOutPutPopUpWindow.setScene(new Scene(borderPane, 400, 120)); |
40 | 43 | showOutPutPopUpWindow.setTitle(title);
|
41 | 44 | showOutPutPopUpWindow.showAndWait();
|
42 | 45 | }
|
|
0 commit comments