Java non static method playCompletely cannot be referenced from a static context
<p>I've been trying to create a method (in a separate class) that takes a String as a parameter and uses a premade SoundEngine (a different class) object to play that file inputted as a string. This is the code I have so far. The problem comes up with<br>
SoundEngine.playCompletely(file);</p>

<pre><code>import java.util.ArrayList;

public class AudioFileList
{
   // Field for a quantity of notes.
   private ArrayList&lt;String&gt; files;

   // Constructor that initializes the array field.
   public AudioFileList()
   {
        files = new ArrayList&lt;String&gt;();
   }

   // Method to add file names to the collection.
   public void addFile(String file)
   {
        files.add(file);
   }

   // Method to return number of files in the collection.
   public int getNumberOfFiles()
   {
        return files.size();
   }

   // Method to print the strings in the collection.
   public void listFiles()
   {
        int index = 0;
        while(index &lt; files.size())
        {
            System.out.println( index + ":" + files.get(index));
            index++;
            }
   }

   // Method that removes an item from the collection.
   public void removeFile(int fileNumber)
   {
        if(fileNumber &lt; 0) 
            { 
                System.out.println ("This is not a valid file number");
            }
        else if(fileNumber &lt; getNumberOfFiles())
            { 
                files.remove(fileNumber);
            }
        else 
            { 
                System.out.println ("This is not a valid file number");
            }
   }    

   // Method that causes the files in the collection to be played.

   public void playFile(String file)
   {
   SoundEngine.playCompletely(file);
   }

}
</code></pre>

<p>Any help is very much appreciated.</p>
