private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
       
        Element selectedElement = (Element) ElList.getSelectedValue();
        SetOfAssets elementAssets = new SetOfAssets();
      
        for (int i=0; i<AssList.getSelectedValuesList().size(); i++){
                        
                        elementAssets.add((Asset) AssList.getModel().getElementAt(i));
                    }
                        
        //selectedElement.SetOfAssets((SetOfAssets) AssList.getSelectedValuesList());
                   
          try {
                    //connection.close();
                    
                    //elementAssets = (SetOfAssets) AssList.getSelectedValuesList();
                    //requires code to put each asset selected in GUI to be put into "elementAssets"
                    Statement statement;
                    statement = connection.createStatement();
                    for (int i=0; i<elementAssets.size(); i++){
                        
                        //statement.executeUpdate( "INSERT INTO User(firstName,surname, username, password) "
                    //+ "VALUES ('" + firstName + "', '" + surname + "','" + username + "', '" + password + "');");
                        
                        int assid = elementAssets.get(i).getAssetID();
                        int eleid = selectedElement.getElementID();
                        
                        //statement.executeUpdate("INSERT INTO SetOFAssets(elementID, assetID)"
                                //+ "VALUES (" + eleid + "," + assid + ");" );
                        
                        statement.executeUpdate("INSERT INTO SetOFAssets(elementID, assetID)"
                                + "VALUES (1,3);" );
                    }
                } catch (SQLException ex) {
                     System.out.println("ERROR: " + ex);
                }
        
        
        
                    ElList.setListData(AllElements);
                    AssList.setListData(AllAssets);
        
        
    }//GEN-LAST:event_jButton3ActionPerformed