public void staff(String[] lab, JPanel staffPane, int loggedId) {

        this.staffPane = staffPane;
        JScrollPane patientsSP = new JScrollPane(tpPatiens);
        JScrollPane staffinfoSP = new JScrollPane(staffinfoTP);
        StringBuffer loggedUser = new StringBuffer();
        JTextPane tpLoggedStaff = new JTextPane();

        this.spQualificationList = new JScrollPane(this.qualificationList);
        this.qualificationList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        this.qualificationList.setSelectedIndex(0);
        this.qualificationList.setVisibleRowCount(3);
        this.function.setOpacity(this.spQualificationList);

// for welcome label
        for (int i = 0; i < staff.size(); i++) {
            if (staff.get(i).getId() == loggedId) {
                loggedUser.append("<b>" + staff.get(i).getLname());
                loggedUser.append(", ");
                loggedUser.append(staff.get(i).getFname() + "</b>");
                if (staff.get(i).getPosition().equalsIgnoreCase("gp")) {
                    loggedUser.append("  [logged as Dr.]");
                } else if (staff.get(i).getPosition().equalsIgnoreCase("ns")) {
                    loggedUser.append("  [logged as R.N.]");
                } else if (staff.get(i).getPosition().equalsIgnoreCase("ma")) {
                    loggedUser.append("  [logged as Med.As.]");
                } else if (staff.get(i).getPosition().equalsIgnoreCase("mo")) {
                    loggedUser.append("  [logged as Med.Of.]");
                }

            }
        }
        tpLoggedStaff.setContentType("text/html");
        tpLoggedStaff.setText(loggedUser.toString());
        this.function.setOpacity(tpLoggedStaff);
        tpLoggedStaff.setEditable(false);


        this.labels = lab;

        // staff list for auto filling
        staffList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        staffList.setSelectedIndex(0);
        staffList.setVisibleRowCount(8);

        hospStaffList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        hospStaffList.setSelectedIndex(0);
        hospStaffList.setVisibleRowCount(8);

        this.hospitalsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        this.hospitalsList.setSelectedIndex(0);
        this.hospitalsList.setVisibleRowCount(3);

        this.positionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        this.positionList.setSelectedIndex(0);
        this.positionList.setVisibleRowCount(3);

        staffTF = new JTextField[labels.length];
        staffSP = new JScrollPane[staffTF.length];

        this.btnAddStaff.setText("Add Staff");
        this.btnEditStaff.setText("Edit Staff");

        for (int i = 0; i < labels.length; i++) {
            staffTF[i] = new JTextField(15);
            this.staffSP[i] = new JScrollPane(staffTF[i]);
            this.function.makeElementWithBorder(staffSP[i], labels[i], Color.LIGHT_GRAY.darker(), false);
            staffTF[i].setBorder(null);
            this.function.setOpacity(staffSP[i]);
            staffSP[i].setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
            staffSP[i].setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            staffTF[i].setOpaque(false);
            staffTF[i].setEditable(false);
        }

        // set opacity for left panel
        this.function.setOpacity(tpPatiens);
        this.function.setOpacity(patientsSP);

        //set opacity for info panel
        this.function.setOpacity(staffinfoTP);
        this.function.setOpacity(staffinfoSP);

        this.function.setOpacity(staffHospSP);
        this.table.setRowHeight(20);
        this.table.setEnabled(false);

        this.spPositionList = new JScrollPane(this.positionList);
        this.function.setOpacity(this.spPositionList);

        spHospitals = new JScrollPane(this.hospitalsList);
        this.function.setOpacity(spHospitals);

        // set title for list
        this.function.makeElementWithBorder(spQualificationList, "Qualification", Color.RED, true);
        this.function.makeElementWithBorder(staffList, "Staff", null, false);
        this.function.makeElementWithBorder(hospStaffList, "Hospitals", null, false);
        this.function.makeElementWithBorder(spPositionList, "Position", Color.RED, true);
        this.function.makeElementWithBorder(this.spHospitals, "Hospitals", Color.RED, true);
        this.function.makeElementWithBorder(staffHospSP, "Schedule", null, false);


        final JTextPane timeTP = new JTextPane();
        timeTP.setContentType("text/html");
        timeTP.setPreferredSize(new Dimension(200, 24));
        timeTP.setEditable(false);
        timeTP.setOpaque(false);
        timeTP.setBorder(null);
        final SimpleDateFormat dateFormat = new SimpleDateFormat("EEEEE, MMMMM d, yyyy");
        final SimpleDateFormat timeFormat = new SimpleDateFormat("h:mm:ss a");

        JScrollPane dlistSP = new JScrollPane(staffList);
        this.function.setOpacity(dlistSP);

        hlistSP = new JScrollPane(hospStaffList);
        this.function.setOpacity(hlistSP);

        // building pane
        this.staffPane.add(timeTP, new GridBagConstraints(0, 0, 2, 2, 0, 0, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(15, 15, 0, 15), 0, 0));
        this.staffPane.add(tpLoggedStaff, new GridBagConstraints(0, 1, 2, 1, 0, 0, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(15, 15, 0, 15), 0, 0));
        this.staffPane.add(patientsSP, new GridBagConstraints(0, 2, 2, 13, 0.7, 1, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(15, 15, 15, 15), 0, 0));
        this.staffPane.add(new JLabel("Staff"), new GridBagConstraints(2, 0, 2, 1, 0, 0, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(15, 0, 15, 0), 0, 0));
        this.staffPane.add(dlistSP, new GridBagConstraints(4, 0, 1, 4, 0.1, 0, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(15, 15, 15, 15), 5, 5));
        this.staffPane.add(findStaffTF, new GridBagConstraints(2, 1, 2, 1, 0.5, 0, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(0, 0, 15, 15), 5, 5));
        this.staffPane.add(staffinfoSP, new GridBagConstraints(2, 2, 2, 2, 0.7, 0.1, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(0, 0, 15, 15), 5, 5));

        this.staffPane.add(hlistSP, new GridBagConstraints(2, 8, 1, 5, 0.1, 0.2, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(0, 0, 15, 15), 5, 5));
        this.staffPane.add(staffHospSP, new GridBagConstraints(3, 8, 2, 5, 0.1, 0.2, GridBagConstraints.NORTHWEST,
                GridBagConstraints.BOTH, new Insets(0, 0, 15, 15), 5, 5));

        this.staffPane.add(this.btnAddStaff, new GridBagConstraints(2, 13, 3, 1, 1, 0, GridBagConstraints.LINE_END,
                GridBagConstraints.NONE, new Insets(0, 0, 15, 15), 5, 5));
        this.staffPane.add(this.btnEditStaff, new GridBagConstraints(3, 13, 2, 1, 0, 0, GridBagConstraints.CENTER,
                GridBagConstraints.NONE, new Insets(0, 0, 15, 15), 5, 5));

        int pozY = 4, pozX = 1;
        for (int i = 0; i < labels.length; i++) {
            this.staffPane.add(staffSP[i], new GridBagConstraints(++pozX, pozY, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
                    GridBagConstraints.HORIZONTAL, new Insets(0, 0, 15, 15), 15, 15));
            if ((i + 1) % 3 == 0) {
                pozY++;
                pozX = 1;
            }
        }

        // fill the informations through the timer (
        new javax.swing.Timer(500000, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                javax.swing.SwingUtilities.invokeLater(new Runnable() {

                    public void run() {
                        function.fillStaff(staff);
                    }
                });
            }
        }).start();

        //time and date
        new javax.swing.Timer(1000, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                Calendar date = Calendar.getInstance();
                timeTP.setText("<b>" + dateFormat.format(date.getTime()) +
                        "<br />" + timeFormat.format(date.getTime()) + "</b>");
            }
        }).start();


        // filling lists  //


        this.function.setElementList(listPosition, true, false);
        this.function.setElementList(listQual, false, true);
        this.function.setHospitalsList(this.listhospitals);

        findStaffTF.addKeyListener(this);
        staffList.addListSelectionListener(this);
        this.btnAddStaff.addActionListener(this);
        this.btnEditStaff.addActionListener(this);
        this.hospStaffList.addListSelectionListener(this);
        this.positionList.addListSelectionListener(this);
        this.qualificationList.addListSelectionListener(this);
    }