private void fillInElementsOnProjectList(int projectID){
        listOfElements.clear();
        if (projectID >=1){
            try{
                ResultSet elementsOnProjectListResultSet = null;
                Statement statement;
                statement = connection.createStatement();
                elementsOnProjectListResultSet = statement.executeQuery("SELECT Element.elementID, Element.elementName, SetOFElements.ProjectID FROM Element INNER JOIN SetOFElements ON Element.[elementID] = SetOFElements.[elementID] WHERE ProjectID="+ projectID +";"); 
                int elementID;
                String elementName;

                while(elementsOnProjectListResultSet.next())
                {
                    elementID = elementsOnProjectListResultSet.getInt("elementID");
                    elementName = elementsOnProjectListResultSet.getString("elementName");
                    Element element = new Element(elementID,elementName);
                    listOfElements.add(element);
                    listElementsList.setListData(listOfElements);
                    ProjectElementsListCellRenderer renderer = new ProjectElementsListCellRenderer(); //custom cell renderer to display property rather than useless object.toString()
                    listElementsList.setCellRenderer(renderer);
                }
            }catch(SQLException err)
                    {
                        System.out.println("ERROR: " + err);
                        JOptionPane.showMessageDialog(null,"* Cannot connect to database! *");
                        System.exit(1);
                    }
        }else{
            listOfElements.clear();
            listElementsList.setListData(listOfElements);
            listElementsList.repaint();
        }
    }