Skip to content
Snippets Groups Projects
Commit 6dfc26f0 authored by Harry Linrui XU's avatar Harry Linrui XU
Browse files

Copied over code from Emil from older commit

parent d82555d2
No related branches found
No related tags found
1 merge request!6Merging the frontend baseline to get up to date with the progress
......@@ -15,7 +15,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.8.1</junit.version>
<javafx.version>17.0.1</javafx.version>
<javafx.version>17.0.6</javafx.version>
</properties>
<repositories>
......@@ -172,7 +172,8 @@
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>no.ntnu.idatt1002.demo/no.ntnu.idatt1002.demo.MyApp</mainClass>
<mainClass>no.ntnu.idatt1002.demo.MyApp</mainClass>
<executable>C:\Program Files\Java\jdk-17\bin\java.exe</executable>
<launcher>app</launcher>
<jlinkZipName>app</jlinkZipName>
<jlinkImageName>app</jlinkImageName>
......
......@@ -10,10 +10,9 @@ import java.util.Objects;
public class MyApp extends Application {
@Override
@Override
public void start(Stage stage) {
try {
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("FirstMenu.fxml")));
Scene scene = new Scene(root);
stage.setScene(scene);
......
......@@ -2,6 +2,7 @@ package no.ntnu.idatt1002.demo;
import java.io.IOException;
import java.util.Objects;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
......@@ -16,7 +17,8 @@ public class sceneController {
private Parent root;
public void switchStartMenu(ActionEvent event) throws IOException {
root = FXMLLoader.load(getClass().getResource("view/StartMenu.fxml"));
root = FXMLLoader.load(
Objects.requireNonNull(getClass().getResource("view/StartMenu.fxml")));
stage = (Stage)((Node)event.getSource()).getScene().getWindow();
scene = new Scene(root);
stage.setScene(scene);
......@@ -24,7 +26,8 @@ public class sceneController {
}
public void switchNewBudget(ActionEvent event) throws IOException {
root = FXMLLoader.load(getClass().getResource("view/NewBudget.fxml"));
root = FXMLLoader.load(
Objects.requireNonNull(getClass().getResource("view/NewBudget.fxml")));
stage = (Stage)((Node)event.getSource()).getScene().getWindow();
scene = new Scene(root);
stage.setScene(scene);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment