Advertisement
Guest User

Untitled

a guest
Apr 30th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // This method will redirect the scene into the patient TableView
  2. public void changeSceneToDoctorPage(ActionEvent event) throws IOException
  3. {
  4. String username = "Insulinpump";
  5. String password = "1234";
  6.  
  7. if(TextUsername.getText().equals(username) && TextPassword.getText().equals(password)) {
  8. Parent tableViewParent = FXMLLoader.load(getClass().getResource("../../../com/InsulinPump/view/DoctorPage.fxml"));
  9. Scene tableViewScene = new Scene(tableViewParent);
  10. Stage window = (Stage)((Node)event.getSource()).getScene().getWindow();
  11. window.setTitle("Insulin Pump");
  12. window.getIcons().add(new Image("/com/InsulinPump/images/blueHeartbeat.png"));
  13. window.setScene(tableViewScene);
  14. window.show();
  15. }
  16. else {
  17. Alert alert = new Alert(AlertType.ERROR);
  18. alert.setTitle("Username Error");
  19. alert.setHeaderText("Username Error");
  20. alert.setContentText("The Username/Password entered is invalid, please enter a valid Username/Password");
  21. alert.showAndWait();
  22. }
  23. }
  24.  
  25.  
  26. public void initialize (URL url, ResourceBundle rb) {
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement