Skip to content
Snippets Groups Projects
Commit c846d371 authored by Kjetil Karstensen Indrehus's avatar Kjetil Karstensen Indrehus
Browse files

add: added alert box for version

parent 4927d970
No related branches found
No related tags found
No related merge requests found
......@@ -11,10 +11,12 @@ import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import no.ntnu.cardgame.Backend.*;
import java.net.URL;
import java.util.ArrayList;
import java.util.Optional;
import java.util.ResourceBundle;
public class Controller implements Initializable {
......@@ -152,6 +154,14 @@ public class Controller implements Initializable {
}
@FXML
public void onVersion(){
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setHeaderText("Version: v.0.0.1");
alert.initStyle(StageStyle.UNDECORATED);
Optional<ButtonType> result = alert.showAndWait();
}
......
......@@ -17,8 +17,8 @@ public class Main extends Application {
Scene scene = new Scene(loader.load());
stage.setTitle("Card Application");
stage.setScene(scene);
//stage.setResizable(false);
stage.initStyle(StageStyle.UTILITY);
stage.setResizable(false);
stage.initStyle(StageStyle.UNDECORATED);
stage.show();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
......@@ -14,6 +13,5 @@
</image>
</ImageView>
<ProgressBar layoutX="301.0" layoutY="308.0" prefWidth="200.0" />
<Button layoutX="336.0" layoutY="336.0" mnemonicParsing="false" text="PLAY [Check cards]" />
</children>
</AnchorPane>
......@@ -138,7 +138,7 @@
</Menu>
<Menu mnemonicParsing="false" text="About">
<items>
<MenuItem mnemonicParsing="false" text="Version" />
<MenuItem mnemonicParsing="false" onAction="#onVersion" text="Version" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="About" />
</items>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment