Class AdminController

java.lang.Object
com.ehealthsystem.admin.AdminController
All Implemented Interfaces:
javafx.fxml.Initializable

public class AdminController extends Object implements javafx.fxml.Initializable
Controller class for admin-view.fxml. Used to handle the interaction between user and program for the scene
  • Field Details

  • Constructor Details

    • AdminController

      public AdminController()
  • Method Details

    • initialize

      public void initialize(URL url, ResourceBundle resourceBundle)
      First method when scene is switches used to call the needed function for loading user inforamtion
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      url -
      resourceBundle -
    • loadUsersFromDatabase

      private void loadUsersFromDatabase() throws SQLException
      Load the users from the data base and store them in an observable. Define which Column of the Tableview corresponds to which value of the attributes of the UserTableView class and fill the table
      Throws:
      SQLException - throws sql exception if the method of causes one
    • handleEdit

      private void handleEdit()
      Add the Event Handler for dynamically for the columns
    • handleDeleteButton

      public void handleDeleteButton(javafx.event.ActionEvent event) throws IOException, SQLException
      Deltes a selected user from the database if the delete button is clicked
      Parameters:
      event -
      Throws:
      IOException
      SQLException
    • handleLogout

      public void handleLogout(javafx.event.ActionEvent event) throws IOException
      logs the admin out
      Parameters:
      event -
      Throws:
      IOException