Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sample;
- import javafx.event.ActionEvent;
- import javafx.fxml.FXML;
- import javafx.fxml.FXMLLoader;
- import javafx.scene.Parent;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.stage.Stage;
- import java.io.IOException;
- public class MainMenu {
- @FXML Button Goals_Main;
- @FXML Button Habits_Main;
- @FXML
- public void changeScreenToGoals(ActionEvent event) throws IOException {
- Parent GoalsViewParent = FXMLLoader.load(getClass().getResource("Goals.fxml"));
- Scene GoalsViewScene = new Scene(GoalsViewParent);
- Stage Goals_window = (Stage) ((javafx.scene.Node) event.getSource()).getScene().getWindow();
- Goals_window.setScene(GoalsViewScene);
- Goals_window.show();
- }
- @FXML
- public void changeScreenToHabits(ActionEvent event) throws IOException {
- Parent HabitsViewParent = FXMLLoader.load(getClass().getResource("Habits.fxml"));
- Scene HabitsViewScene = new Scene(HabitsViewParent);
- Stage Habits_window = (Stage) ((javafx.scene.Node) event.getSource()).getScene().getWindow();
- Habits_window.setScene(HabitsViewScene);
- Habits_window.show();
- }
- @FXML
- public void changeScreenToEditPersonalInfo(ActionEvent event) throws IOException {
- Parent PersonalInfoViewParent = FXMLLoader.load(getClass().getResource("PersonalInformation.fxml"));
- Scene PersonalInfoViewScene = new Scene(PersonalInfoViewParent);
- Stage PersonalInfo_window = (Stage) ((javafx.scene.Node) event.getSource()).getScene().getWindow();
- PersonalInfo_window.setScene(PersonalInfoViewScene);
- PersonalInfo_window.show();
- }
- public void Exit(ActionEvent event) {
- System.exit(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement