Class Main

java.lang.Object
javafx.application.Application
com.ehealthsystem.Main

public class Main extends javafx.application.Application
  • Nested Class Summary

    Nested classes/interfaces inherited from class javafx.application.Application

    javafx.application.Application.Parameters
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static javafx.stage.Stage
     

    Fields inherited from class javafx.application.Application

    STYLESHEET_CASPIAN, STYLESHEET_MODENA
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javafx.stage.Stage
    Get the application's primary stage.
    private static void
    Set up database
    private static String
    Ask the admin that opens the application for the first time in a text input dialog for an initial admin password when creating the database
    static void
    main(String[] args)
    Main entry point to the application for the operating system.
    void
    start(javafx.stage.Stage primaryStage)
    Required method to run and open the first JavaFX window of an application.

    Methods inherited from class javafx.application.Application

    getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • primaryStage

      static javafx.stage.Stage primaryStage
  • Constructor Details

    • Main

      public Main()
  • Method Details

    • start

      public void start(javafx.stage.Stage primaryStage) throws IOException, SQLException
      Required method to run and open the first JavaFX window of an application.
      Specified by:
      start in class javafx.application.Application
      Parameters:
      primaryStage - the main window/stage the scene is loaded into
      Throws:
      IOException - needs to throw an IOException in case the .fxml file to open isn't found
      SQLException
    • main

      public static void main(String[] args) throws SQLException
      Main entry point to the application for the operating system.
      Parameters:
      args - Command arguments
      Throws:
      SQLException
    • initDB

      private static void initDB() throws SQLException
      Set up database
      Throws:
      SQLException - if a statement failed in the creation process
    • initialAdminPassword

      private static String initialAdminPassword()
      Ask the admin that opens the application for the first time in a text input dialog for an initial admin password when creating the database
      Returns:
      desired admin password entered by the admin
    • getPrimaryStage

      public static javafx.stage.Stage getPrimaryStage()
      Get the application's primary stage. As the application only works with a single stage of which the content is only changed on scene switch, this is a helper method to get the application's stage. Used to switch scenes. Implemented in Main as this class initially defines the primary stage.
      Returns:
      the primary stage the application runs on.