private void setRoles() {
        //initial states
        roleStateAdministrator = 0;
        roleStateProjektledare = 0;
        roleStateSpecialist = 0;
        cbAdministrator.setEnabled(false);
        cbProjektledare.setEnabled(false);
        cbSpecialist.setEnabled(false);

        int pl;
        int sp;
        int ad;

        try {
            String query = "select count(*) from projektledare where aid=" + selectedAnstalld;
            pl = Integer.parseInt(DB.fetchSingle(query));
        } catch (InfException | NumberFormatException e) {
            e.getMessage();
            pl = 0;
        }

        try {
            String query = "select count(*) from administrator where aid=" + selectedAnstalld;
            ad = Integer.parseInt(DB.fetchSingle(query));
        } catch (InfException | NumberFormatException e) {
            e.getMessage();
            ad = 0;
        }

        try {
            String query = "select count(*) from specialist where aid=" + selectedAnstalld;
            sp = Integer.parseInt(DB.fetchSingle(query));
        } catch (InfException | NumberFormatException e) {
            e.getMessage();
            sp = 0;
        }

        //if the anstalld was found as either of the roles set the ui accordingly
        if (pl == 1) {
            cbProjektledare.setSelected(true);
            roleStateProjektledare = 1;
            setLeadProjekt();
        }
        if (sp == 1) {
            cbSpecialist.setSelected(true);
            roleStateSpecialist = 1;
            setJPaneKompetenser();
            setJPaneProjekt();
        }
        if (ad == 1) {
            cbAdministrator.setSelected(true);
            roleStateAdministrator = 1;
            passwordIfAdministrator();
            lblAdminUsername.setText("Administratörs användarnamn: " + selectedAnstalld);
            lblAdminUsername.setVisible(true);
        }
    }