diff --git a/src/main/java/no/ntnu/idatt1002/demo/view/SceneController.java b/src/main/java/no/ntnu/idatt1002/demo/view/SceneController.java index efaaef7b8c68b6da859d314c8b403b3f476e5272..941a33a530c196de02a48a3ed9329b009748e6b6 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/view/SceneController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/view/SceneController.java @@ -32,4 +32,12 @@ public class SceneController { stage.setScene(scene); stage.show(); } -} \ No newline at end of file + + public void switchExpenses(ActionEvent event) throws IOException { + FXMLLoader loader = new FXMLLoader(SceneController.class.getResource("/view/Expenses.fxml")); + Parent root = loader.load(); + stage = (Stage)((Node)event.getSource()).getScene().getWindow(); + scene = new Scene(root); + stage.setScene(scene); + stage.show(); + }} \ No newline at end of file