private void updateAnstalldaInPanel() {
        tfAnstalldSearch.setEnabled(false); //lets disable it meanwhile we update
        PanelHelper.cleanPanel(anstalldHolderPanel);
        ArrayList<String> matches = fetchMatchingAnstallda();
        if (!matches.isEmpty()) {
            for (String st : matches) {
                HashMap<String, String> hm = fetchAnstalldInfo(st);
                if (hm != null) {
                    PanelHelper.addPanelToPanel(new AnstalldPanelViewbox(hm.get("AID"), hm.get("NAMN"), hm.get("TELEFON"), hm.get("MAIL")), anstalldHolderPanel, 150, 120);
                } else {
                    JPanel panel = new JPanel();
                    panel.add(new JLabel("Sökningen misslyckades, försök igen."));
                    panel.setVisible(true);
                    PanelHelper.addPanelToPanel(panel, anstalldHolderPanel, 500, 200);
                }
            }
            Dimension d = anstalldHolderPanel.getPreferredSize(); //set the scroll to the right size
            int count = matches.size();
            int height = count * 125 / 3;
            if (count % 3 != 0) {
                if (count % 3 == 1) {
                    height += 88;
                }
                if (count % 3 == 2) {
                    height += 44;
                }
            }
            d.setSize(500, height); //sets the size of the panel to the right preferred size
            anstalldHolderPanel.setPreferredSize(d);
        } else { // none found
            JPanel panel = new JPanel();
            panel.add(new JLabel("Sökningen gav inget resultat, försök att göra din sökning mindre specifik"));
            panel.setVisible(true);
            PanelHelper.addPanelToPanel(panel, anstalldHolderPanel, 500, 200);
            Dimension d = anstalldHolderPanel.getPreferredSize();
            d.setSize(500, 100);
            anstalldHolderPanel.setPreferredSize(d);
        }

        tfAnstalldSearch.setEnabled(true); // enable typing again
    }