private void addChosenPlattform() {
        lblPlattformError.setVisible(false);
        DefaultListModel<Plattform> dlm = (DefaultListModel<Plattform>) listChosenPlattformar.getModel();
        Plattform chosen = (Plattform) cbPlattformar.getSelectedItem();
        boolean exists = false; // search if the same plattform has already been added
        for (int i = 0; i < dlm.getSize() && !exists; i++) {
            Plattform comp = dlm.get(i);
            if (chosen.getPid() == comp.getPid()) {
                exists = true;
            }
        }
        if (!exists) {
            dlm.addElement(chosen);
        } else {
            lblPlattformError.setText("Kan inte lägga till " + chosen + " igen.");
            lblPlattformError.setVisible(true);
        }
    }