src/com/company/Client/CovidTest.java
@Override
    public void start(Stage primaryStage) {
        this.covidTestWindow = primaryStage;

        // Method responsible for saving user information, when the user interface window is closed
        this.covidTestWindow.setOnCloseRequest(e -> {
            e.consume();

            try {
                out = new PrintWriter(socket.getOutputStream(), true);

                this.client.setCommand("LOGOUT");
                out.println(this.client.toString());

                covidTestWindow.close();
                System.exit(-1);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }

        });

        // Scene Title
        this.sceneLabel = new Label();
        this.sceneLabel.setText("COVID-19 TEST");
        this.sceneLabel.setFont(new Font(30));

        // Description
        this.descLabel = new Label();
        this.descLabel.setText("Click the button below to do the test:");
        this.descLabel.setFont(new Font(20));

        // Button "Take Test"
        this.covidTestButton = new Button("Take Test");

        if (!this.client.isInfected()) {
            this.covidTestButton.setOnAction(e -> {
                try {
                    out = new PrintWriter(socket.getOutputStream(), true);
                    this.client.setCommand("COVID TEST BUTTON");
                    out.println(this.client.toString());
                } catch (UnknownHostException ex) {
                    System.out.println("Unknown Host.");
                    System.exit(1);
                } catch (IOException ex) {
                    System.out.println(ex.getMessage());
                }
            });
        } else {
            this.covidTestButton.setDisable(true);
        }

        // Button "Return to Main Menu"
        this.returnMenuButton = new Button("Return to Main Menu");

        this.returnMenuButton.setOnAction(e -> {
            MenuPage menuPage = null;
            try {
                menuPage = new MenuPage(socket, client);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
            try {
                menuPage.start(this.covidTestWindow);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        });

        VBox titlesContainer = new VBox(20);
        titlesContainer.setAlignment(Pos.CENTER);
        titlesContainer.getChildren().addAll(this.sceneLabel, this.descLabel);

        VBox contentContainer = new VBox(20);
        contentContainer.setAlignment(Pos.CENTER);
        contentContainer.setPadding(new Insets(0, 40, 40, 40));
        contentContainer.getChildren().addAll(this.covidTestButton, this.returnMenuButton);

        BorderPane borderPanelayout = new BorderPane();
        borderPanelayout.setCenter(contentContainer);
        borderPanelayout.setTop(titlesContainer);

        this.covidTestScene = new Scene(borderPanelayout, LoginMenu.getSceneWidth(), LoginMenu.getSceneHeight());

        this.covidTestWindow.setScene(this.covidTestScene);
        this.covidTestWindow.show();

    }
/**
     * Method responsible for starting the user interface "Covid Test"
     *
     * @param primaryStage - Main Container of JavaFX
     */
Method responsible for starting the user interface "Covid Test"
@param primaryStage - Main Container of JavaFX
Method responsible for starting the user interface " Covid Test " @param primaryStage - Main Container of JavaFX
@Override
    public void start(Stage primaryStage) {
        this.covidTestWindow = primaryStage;
        this.covidTestWindow.setOnCloseRequest(e -> {
            e.consume();
            try {
                out = new PrintWriter(socket.getOutputStream(), true);
                this.client.setCommand("LOGOUT");
                out.println(this.client.toString());
                covidTestWindow.close();
                System.exit(-1);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        });
        this.sceneLabel = new Label();
        this.sceneLabel.setText("COVID-19 TEST");
        this.sceneLabel.setFont(new Font(30));
        this.descLabel = new Label();
        this.descLabel.setText("Click the button below to do the test:");
        this.descLabel.setFont(new Font(20));
        this.covidTestButton = new Button("Take Test");
        if (!this.client.isInfected()) {
            this.covidTestButton.setOnAction(e -> {
                try {
                    out = new PrintWriter(socket.getOutputStream(), true);
                    this.client.setCommand("COVID TEST BUTTON");
                    out.println(this.client.toString());
                } catch (UnknownHostException ex) {
                    System.out.println("Unknown Host.");
                    System.exit(1);
                } catch (IOException ex) {
                    System.out.println(ex.getMessage());
                }
            });
        } else {
            this.covidTestButton.setDisable(true);
        }
        this.returnMenuButton = new Button("Return to Main Menu");
        this.returnMenuButton.setOnAction(e -> {
            MenuPage menuPage = null;
            try {
                menuPage = new MenuPage(socket, client);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
            try {
                menuPage.start(this.covidTestWindow);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        });
        VBox titlesContainer = new VBox(20);
        titlesContainer.setAlignment(Pos.CENTER);
        titlesContainer.getChildren().addAll(this.sceneLabel, this.descLabel);
        VBox contentContainer = new VBox(20);
        contentContainer.setAlignment(Pos.CENTER);
        contentContainer.setPadding(new Insets(0, 40, 40, 40));
        contentContainer.getChildren().addAll(this.covidTestButton, this.returnMenuButton);
        BorderPane borderPanelayout = new BorderPane();
        borderPanelayout.setCenter(contentContainer);
        borderPanelayout.setTop(titlesContainer);
        this.covidTestScene = new Scene(borderPanelayout, LoginMenu.getSceneWidth(), LoginMenu.getSceneHeight());
        this.covidTestWindow.setScene(this.covidTestScene);
        this.covidTestWindow.show();
    }
@ Override public void start ( Stage primaryStage ) { this . covidTestWindow = primaryStage ; this . covidTestWindow . setOnCloseRequest ( e -> { e . consume ( ) ; try { out = new PrintWriter ( socket . getOutputStream ( ) , true ) ; this . client . setCommand ( "LOGOUT" ) ; out . println ( this . client . toString ( ) ) ; covidTestWindow . close ( ) ; System . exit ( - 1 ) ; } catch ( IOException ioException ) { ioException . printStackTrace ( ) ; } } ) ; this . sceneLabel = new Label ( ) ; this . sceneLabel . setText ( "COVID-19 TEST" ) ; this . sceneLabel . setFont ( new Font ( 30 ) ) ; this . descLabel = new Label ( ) ; this . descLabel . setText ( "Click the button below to do the test:" ) ; this . descLabel . setFont ( new Font ( 20 ) ) ; this . covidTestButton = new Button ( "Take Test" ) ; if ( ! this . client . isInfected ( ) ) { this . covidTestButton . setOnAction ( e -> { try { out = new PrintWriter ( socket . getOutputStream ( ) , true ) ; this . client . setCommand ( "COVID TEST BUTTON" ) ; out . println ( this . client . toString ( ) ) ; } catch ( UnknownHostException ex ) { System . out . println ( "Unknown Host." ) ; System . exit ( 1 ) ; } catch ( IOException ex ) { System . out . println ( ex . getMessage ( ) ) ; } } ) ; } else { this . covidTestButton . setDisable ( true ) ; } this . returnMenuButton = new Button ( "Return to Main Menu" ) ; this . returnMenuButton . setOnAction ( e -> { MenuPage menuPage = null ; try { menuPage = new MenuPage ( socket , client ) ; } catch ( IOException ioException ) { ioException . printStackTrace ( ) ; } try { menuPage . start ( this . covidTestWindow ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } ) ; VBox titlesContainer = new VBox ( 20 ) ; titlesContainer . setAlignment ( Pos . CENTER ) ; titlesContainer . getChildren ( ) . addAll ( this . sceneLabel , this . descLabel ) ; VBox contentContainer = new VBox ( 20 ) ; contentContainer . setAlignment ( Pos . CENTER ) ; contentContainer . setPadding ( new Insets ( 0 , 40 , 40 , 40 ) ) ; contentContainer . getChildren ( ) . addAll ( this . covidTestButton , this . returnMenuButton ) ; BorderPane borderPanelayout = new BorderPane ( ) ; borderPanelayout . setCenter ( contentContainer ) ; borderPanelayout . setTop ( titlesContainer ) ; this . covidTestScene = new Scene ( borderPanelayout , LoginMenu . getSceneWidth ( ) , LoginMenu . getSceneHeight ( ) ) ; this . covidTestWindow . setScene ( this . covidTestScene ) ; this . covidTestWindow . show ( ) ; }
Method responsible for starting the user interface "Covid Test"
 @param primaryStage - Main Container of JavaFX
Method responsible for starting the user interface " Covid Test " @param primaryStage - Main Container of JavaFX
// Method responsible for saving user information, when the user interface window is closed // Scene Title // Description // Button "Take Test" // Button "Return to Main Menu"