diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/MainMenu.java b/src/main/java/no/ntnu/idatt1002/demo/controller/MainMenu.java index 71a7f39bf61426a3a18aa8d6d85d0e76999849fd..2d62ad8bf5a89d7b949b237ddc5e627f1ce6804c 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/controller/MainMenu.java +++ b/src/main/java/no/ntnu/idatt1002/demo/controller/MainMenu.java @@ -242,7 +242,7 @@ public class MainMenu { private void switchScene(ActionEvent event) throws IOException { FXMLLoader loader = new FXMLLoader(); if (event.getSource() == foodBtn) { - System.out.println("Food button pressed"); + loader.setLocation(getClass().getResource("/view/SuggestRecipes.fxml")); } else if (event.getSource() == expenseBtn) { loader.setLocation(getClass().getResource("/view/IncomeAndExpenses.fxml")); } else if (event.getSource() == incomeBtn) { diff --git a/src/main/resources/view/MainMenuNew.fxml b/src/main/resources/view/MainMenuNew.fxml index 4b685ffcbe099c33c1f3ccb563012006a8a50def..4acfebd9e6cb9bfd0c0fb6f00a6a495fc5cec22a 100644 --- a/src/main/resources/view/MainMenuNew.fxml +++ b/src/main/resources/view/MainMenuNew.fxml @@ -188,7 +188,7 @@ </BorderPane> <TilePane alignment="CENTER" hgap="50.0" prefHeight="215.0" prefWidth="1131.0"> <children> - <Button fx:id="foodBtn" alignment="TOP_CENTER" contentDisplay="TOP" mnemonicParsing="false" prefHeight="100.0" prefWidth="150.0" text="Food"> + <Button fx:id="foodBtn" alignment="TOP_CENTER" contentDisplay="TOP" mnemonicParsing="false" onAction="#switchScene" prefHeight="100.0" prefWidth="150.0" text="Food"> <graphic> <ImageView fitHeight="75.0" fitWidth="75.0" pickOnBounds="true" preserveRatio="true"> <image>