@FXML
  void actionComboBoxHandler(ActionEvent event) throws IOException {

    Parent parent;
    int selectedIndex = actionComboBox.getSelectionModel().getSelectedIndex();
    String title = actionComboBox.getSelectionModel().getSelectedItem();

    // Switch to a different scene based on choice selected by user
    switch (selectedIndex) {
      case 0:
        parent = FXMLLoader.load(getClass().getResource("/fxml/AddPlayer.fxml"));
        break;
      case 1:
        parent = FXMLLoader.load(getClass().getResource("/fxml/AddGame.fxml"));
        break;
      case 2:
        parent = FXMLLoader.load(getClass().getResource("/fxml/UpdatePlayer.fxml"));
        break;
      case 3:
        parent = FXMLLoader.load(getClass().getResource("/fxml/DisplayPlayerGame.fxml"));
        break;
      default:
        parent = FXMLLoader.load(getClass().getResource("/fxml/MainWindow.fxml"));
        break;
    }

    // Set scene
    super.setScreen(event, parent, title);
  }
예제 #2
0
 @FXML
 protected void handleSubmitButtonAction(ActionEvent event) {
   db.Connect();
   boolean test = db.userExist(username.getText().toString());
   if (test) {
     System.out.println("User Exists");
     test = db.checkPassword(username.getText().toString(), password.getText().toString());
     if (test) {
       // if username and password is correct program moves to main screen
       System.out.println("Password is correct");
       myController.setScreen(WellCheck.screenID2);
       db.patientTable();
     }
   }
   username.clear();
   password.clear();
   System.out.println(username.getText().toString());
 }
예제 #3
0
  /**
   * Goes to Screen 7, passing the ActionEvent
   *
   * @param event
   */
  @FXML
  private void goToScreen7(ActionEvent event) {

    controller.setScreen(ScreenFramework.screen7ID);
  }
예제 #4
0
  /**
   * Goes to Screen 1, passing the ActionEvent
   *
   * @param event
   * @throws IOException
   */
  @FXML
  private void goToScreen1(ActionEvent event) throws IOException {

    controller.setScreen(ScreenFramework.screen1ID);
  }
예제 #5
0
  /**
   * Goes to Screen 6, passing the ActionEvent
   *
   * @param event
   */
  @FXML
  private void goToScreen6(ActionEvent event) {

    controller.setScreen(ScreenFramework.screen6ID); // goto editTask
  }
예제 #6
0
  /**
   * Goes to Screen2 , passing the ActionEvent
   *
   * @param event
   */
  @FXML
  private void goToScreen2(ActionEvent event) {

    controller.setScreen(ScreenFramework.screen2ID); // goto this
  }
예제 #7
0
  /**
   * Goes to Screen 5, passing the ActionEvent
   *
   * @param event
   */
  @FXML
  private void goToScreen5(ActionEvent event) {

    controller.setScreen(ScreenFramework.screen5ID); // goto confirmation -> createTask
  }
예제 #8
0
  /**
   * Goes to Screen 4, passing the ActionEvent
   *
   * @param event
   */
  @FXML
  private void goToScreen4(ActionEvent event) {

    controller.setScreen(ScreenFramework.screen4ID); // goto create Task
  }