title: JList to list toString() of an ArrayList of Objects
body: <p>I have an ArrayList of objects (A class called OrderItem). OrderItem has a toString() method in it.</p>
  
  <p>I also have a GUI class in which I have a JList. I want to list all the toString()'s for the elements of the arrayLists.</p>
  
  <p>I know that for an arrayList of strings you can make them show in a JList by using:</p>
  
  <pre><code>ArrayList&lt;String&gt; myArrayList  = new ArrayList&lt;String&gt;();
  myArrayList.add("Value1");
  myArrayList.add("Value2");
  myJList = new JList(myArrayList.toArray());
  </code></pre>
  
  <p>But I want to list the toString() methods of an object arrayList, i.e. have something like:</p>
  
  <pre><code>ArrayList&lt;OrderItem&gt; myArrayList  = new ArrayList&lt;OrderItem&gt;();
  myJList = new JList(myArrayList.toString());
  </code></pre>
  
  <p>I realise that there is a possibility that JList doesn't support such a feature or that there is some sort of logic problem with this. If that is so could you inform me as to why? Because surely an arrayList of strings should work in a similar way to an object arrayList's toString(). I merely want to be pulling out a String value for the elements and using those values for my list.</p>
  
  <p>I've searched the web for an answer and have not been able to find one that helps me, so I've come here to try to get this resolved.</p>
  
  <p>Thanks a lot!</p>