title: cannot find symbol listModel.addElement
body: <p><strong>I am trying to create my first list, and I am stuck on an error.</strong> </p>
  
  <p>Here is the template I am using for the list model:</p>
  
  <pre><code>    private ListModel getListModel() {
  
      String[] arrayOfStrings = new String[3];
      arrayOfStrings[0] = "one";
      arrayOfStrings[1] = "two";
      arrayOfStrings[2] = "three";
  
      ListModel listModel = new DefaultListModel();
  
      for (int i=0;i&lt;arrayOfStrings.length;i++) {
          listModel.addElement(arrayOfStrings[i]);            
      }   
  }    
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>error: cannot find symbol
              listModel.addElement(arrayOfStrings[i]);            
  
  symbol:   method addElement(String)
  
    location: variable listModel of type ListModel
  </code></pre>
  
  <p>I am still new to using interfaces as well as lists. I downloaded an example code for making a list, and their code was very similar. What am I missing? I imported every single thing that the example code imported.</p>