-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #374 from Advanced-Programming-2021/spellsAndSpeci…
…lMonsters music play fixed & show output changed & a bug at shop fixed
- Loading branch information
Showing
5 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,43 @@ | ||
package view.gui; | ||
|
||
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; | ||
|
||
public class ShowOutput { | ||
private static Stage showOutPutPopUpWindow; | ||
|
||
public static void showOutput(String title, String header) { | ||
Alert alert = new Alert(Alert.AlertType.INFORMATION); | ||
alert.setTitle(title); | ||
alert.setHeaderText(header); | ||
alert.show(); | ||
showOutPutPopUpWindow = new Stage(); | ||
showOutPutPopUpWindow.initModality(Modality.APPLICATION_MODAL); | ||
|
||
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.setStyle("-fx-background-color: #0303a4"); | ||
hBox.setAlignment(Pos.BASELINE_LEFT); | ||
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.setStyle("-fx-background-color: #0303a4"); | ||
bottomHBox.setAlignment(Pos.CENTER); | ||
borderPane.setBottom(bottomHBox); | ||
|
||
showOutPutPopUpWindow.setScene(new Scene(borderPane, 350, 90)); | ||
showOutPutPopUpWindow.setTitle(title); | ||
showOutPutPopUpWindow.showAndWait(); | ||
} | ||
} |