Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This method will redirect the scene into the patient TableView
- public void changeSceneToDoctorPage(ActionEvent event) throws IOException
- {
- String username = "Insulinpump";
- String password = "1234";
- if(TextUsername.getText().equals(username) && TextPassword.getText().equals(password)) {
- Parent tableViewParent = FXMLLoader.load(getClass().getResource("../../../com/InsulinPump/view/DoctorPage.fxml"));
- Scene tableViewScene = new Scene(tableViewParent);
- Stage window = (Stage)((Node)event.getSource()).getScene().getWindow();
- window.setTitle("Insulin Pump");
- window.getIcons().add(new Image("/com/InsulinPump/images/blueHeartbeat.png"));
- window.setScene(tableViewScene);
- window.show();
- }
- else {
- Alert alert = new Alert(AlertType.ERROR);
- alert.setTitle("Username Error");
- alert.setHeaderText("Username Error");
- alert.setContentText("The Username/Password entered is invalid, please enter a valid Username/Password");
- alert.showAndWait();
- }
- }
- public void initialize (URL url, ResourceBundle rb) {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement