diff --git a/.idea/misc.xml b/.idea/misc.xml index cdf8ef1..4878ef2 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 467f022..f963052 100644 --- a/pom.xml +++ b/pom.xml @@ -33,14 +33,36 @@ 25.0.1 - - org.junit.jupiter - junit-jupiter - 6.0.1 - test - + + org.openjfx + javafx-fxml + 25.0.1 + - + + org.openjfx + javafx-web + 25.0.1 + + + + org.openjfx + javafx-swing + 25.0.1 + + + + org.openjfx + javafx-media + 25.0.1 + + + + org.junit.jupiter + junit-jupiter + 6.0.1 + test + @@ -60,7 +82,7 @@ javafx-maven-plugin 0.0.8 - edu.ntnu.idi.idatt.Main + edu.ntnu.idi.idatt.gui.javafx diff --git a/src/main/java/edu/ntnu/idi/idatt/gui/javafx.java b/src/main/java/edu/ntnu/idi/idatt/gui/javafx.java new file mode 100644 index 0000000..2e29e2f --- /dev/null +++ b/src/main/java/edu/ntnu/idi/idatt/gui/javafx.java @@ -0,0 +1,44 @@ +package edu.ntnu.idi.idatt.gui; + +import javafx.application.Application; +import javafx.scene.Group; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.paint.Color; +import javafx.stage.Stage; + +import java.awt.*; +import java.io.IOException; + +public class javafx extends Application { + @Override + public void start (Stage stage) throws IOException { + Image stonk = new Image(getClass().getResource("/edu.ntnu.idi.idatt/stonks.png").toExternalForm()); + Button week = new Button("Week 5: Play"); + week.setPrefSize(150, 50); + week.setTranslateX(565); + Button logo = new Button(); + Button user = new Button(); + ImageView user_image = new ImageView(new Image(getClass().getResource("/edu.ntnu.idi.idatt/user.png").toExternalForm())); + ImageView logo_image = new ImageView(new Image(getClass().getResource("/edu.ntnu.idi.idatt/logo.png").toExternalForm())); + logo_image.setFitHeight(100); + logo_image.setFitWidth(100); + user_image.setFitHeight(100); + user_image.setFitWidth(100); + logo.setGraphic(logo_image); + user.setGraphic(user_image); + user.setTranslateX(1170); + ImageView stonks = new ImageView(stonk); + stonks.setX(440); + stonks.setY(220); + Group noe = new Group(stonks, week, logo, user); + Scene scene1 = new Scene(noe, 1280, 720, Color.DEEPSKYBLUE); + logo.setOnAction(e -> stage.setScene(new Scene(new Group(stonks,week,logo,user),1280, 720, Color.DEEPSKYBLUE))); + user.setOnAction(e -> stage.setScene(new Scene(new Group(logo,user),1280, 720, Color.BLACK))); + week.setOnAction(e -> stage.close()); + stage.setScene(scene1); + stage.show(); + } +} diff --git a/src/main/resources/edu.ntnu.idi.idatt/logo.png b/src/main/resources/edu.ntnu.idi.idatt/logo.png new file mode 100644 index 0000000..a8980fe Binary files /dev/null and b/src/main/resources/edu.ntnu.idi.idatt/logo.png differ diff --git a/src/main/resources/edu.ntnu.idi.idatt/stonks.png b/src/main/resources/edu.ntnu.idi.idatt/stonks.png new file mode 100644 index 0000000..db95b50 Binary files /dev/null and b/src/main/resources/edu.ntnu.idi.idatt/stonks.png differ diff --git a/src/main/resources/edu.ntnu.idi.idatt/user.png b/src/main/resources/edu.ntnu.idi.idatt/user.png new file mode 100644 index 0000000..4f64ab8 Binary files /dev/null and b/src/main/resources/edu.ntnu.idi.idatt/user.png differ