private void fillInTaskOnAssetList(Asset asset) {
           
        listOfTasks.clear();
        listTasksList.repaint();
        ResultSet tasksOnAssetListResultSet = null;   
        Statement statement;
        try {
            statement = connection.createStatement();
            tasksOnAssetListResultSet = statement.executeQuery("SELECT * FROM Task WHERE assetID = " + asset.getAssetID() + ";");  
                         randSQL.loadAllUsers();
                         SetOfUsers allusers = randSQL.getAllUsers();

                        while (tasksOnAssetListResultSet.next()){
                            int taskID;
                            int projectID;                        
                            User responsible = null;
                            int taskPriority;
                            String status;
                            String taskName;
                            String taskType;
                            taskID = tasksOnAssetListResultSet.getInt("taskID");
                            projectID = tasksOnAssetListResultSet.getInt("projectID");
   
                            for(int i=0; i<allusers.size();i++){
                                if(tasksOnAssetListResultSet.getInt("responsiblePerson")==allusers.get(i).getUserID());
                                {
                                    responsible = allusers.get(i);
                                    break;
                                }     
                             }                 
                              taskPriority = tasksOnAssetListResultSet.getInt("taskPriority");
                              status = tasksOnAssetListResultSet.getString("status");
                              taskName = tasksOnAssetListResultSet.getString("taskName");
                              taskType = tasksOnAssetListResultSet.getString("type");                   
                              Task newTask = new Task(taskID, responsible,taskName, taskPriority , status,projectID, asset, taskType);                     
                              listOfTasks.add(newTask);
                              listTasksList.setListData(listOfTasks);
                              TasksListCellRenderer renderer = new TasksListCellRenderer();  //custom cell renderer to display property rather than useless object.toString()
                              listTasksList.setCellRenderer(renderer);                 
                         }                     
                        asset.setSetOfTasks(listOfTasks);
                         } catch (SQLException ex) {
            Logger.getLogger(ManagerUI.class.getName()).log(Level.SEVERE, null, ex);
        }
    }