title: Cannot assign my DefaultListModel to my JList in Java NetBeans
body: <p>I have a jList that was generated by NetBeans. I have declared a DefaultListModel but cannot link to up to the jList. My code is below and I have also tried using .setMethod.</p>
  
  <pre><code>        DefaultListModel modeljLstShoppingCartName;
          modeljLstShoppingCartName = new DefaultListModel();
          jLstShoppingCartName = new JList(modeljLstShoppingCartName);
          modeljLstShoppingCartName.addElement("Testing1");
  </code></pre>
  
  <p>The error I am receiving here is on the entire third line where it is saying:</p>
  
  <pre><code>incompatible types
    required: java.awt.List
    found:    javax.swing.JList
  </code></pre>
  
  <p>I have imported: </p>
  
  <pre><code>import javax.swing.*;
  import javax.swing.event.*;
  import javax.swing.DefaultListModel;
  import javax.swing.JList;
  </code></pre>
  
  <p>Any help would be great as I've spent a few hours at this but with no success.</p>