public UserPage(JPanel _contentPane, Hospital _hospital, AdminPage _adminPage) {
        this.hospital = _hospital;
        this.contentPane = _contentPane;
        this.adminPage = _adminPage;
        logOutButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                CardLayout cl = (CardLayout) contentPane.getLayout();
                cl.show(contentPane, "Login Page");
            }
        });

        patientInformation_editButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                updateUserInfoInPatientInformationTab();
                updateViewWithNewUserInfoInPatientInformationTab();
            }
        });

        sendEmailButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                sendEmailToDoctor();
            }

        });

        // Schedules an appointment.
        scheduleAppointment_scheduleAppointmentButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setUpAnAppointment();
            }
        });

        // Button sends user 2 tabs ahead to the Schedule Appointment tab
        patientHistory_scheduleAppointmentButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                userPage_tabbedPane.setSelectedIndex(3);
            }
        });

        // Swap to the admin page with the user's information filled in.
        userViewSurgeries_scheduleSurgeryButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                CardLayout cl = (CardLayout) contentPane.getLayout();
                adminPage.setUserPickedForAdminServices(userNameOfCurrentUser);
                adminPage.updateScheduleSurgeryPageForSelectedUser();
                cl.show(contentPane, "Admin Page");
            }
        });
    }