private void createSpelprojekt() {

        String sid = "";
        Anstalld a = (Anstalld) cbProjektledare.getSelectedItem(); // fetch Anstalld object from combobox
        int aid = a.getAid();
        try {
            sid = DB.getAutoIncrement("spelprojekt", "sid");
            newsid = Integer.parseInt(sid);
        } catch (InfException e) {
            e.getMessage();
        }
        SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy"); //convert the dates
        String sdate = sdf.format(calStartDate.getDate());
        String rdate = sdf.format(calReleaseDate.getDate());
        if (aid != -1) { // a lead was selected
            try {
                String query = "insert into spelprojekt (sid,beteckning,startdatum,releasedatum,aid) values("
                        + sid + ",'" + tfBeteckning.getText() + "','" + sdate + "','" + rdate + "'," + aid + ")";
                DB.insert(query);
            } catch (InfException e) {
                e.getMessage();
            }
        } else if (aid == -1) { // no lead was selected
            try {
                String query = "insert into spelprojekt (sid,beteckning,startdatum,releasedatum,aid) values("
                        + sid + ",'" + tfBeteckning.getText() + "','" + sdate + "','" + rdate + "', null)";
                DB.insert(query);
            } catch (InfException e) {
                e.getMessage();
            }
        }

        //load the chosen plattformar from the jlist
        DefaultListModel<Plattform> dlm = (DefaultListModel<Plattform>) listChosenPlattformar.getModel();

        for (int i = 0; i < dlm.getSize(); i++) {
            try {
                String query = "insert into innefattar (sid,pid) values(" + sid + "," + dlm.get(i).getPid() + ")";
                DB.insert(query);
            } catch (InfException e) {
                e.getMessage();
            }
        }

    }