title: How add elements to the JList parameterized by my own Type
body: <p>I have created a <code>JList</code> but it(and its' model) lacks <code>addElement</code> method. How to add instance of my class <code>Pacjent</code> to that <code>JList</code>?</p>
  
  <pre><code>Pacjent p = new Pacjent("Blosom", "Polo");
  ListModel&lt;Pacjent&gt; model = new DefaultListModel&lt;Pacjent&gt;();
  pList = new JList&lt;Pacjent&gt;(model);
  </code></pre>
  
  <hr>
  
  <pre><code>public class Pacjent extends Osoba {
  
      private String imie;
      private String nazwisko;
      public ArrayList&lt;Ubezpieczenie&gt; ubezpieczenia = new ArrayList&lt;Ubezpieczenie&gt;();
  
  
  ...}
  </code></pre>