title: Adding objects to a JList
body: <p>I have an object - <code>ArrayList&lt;User&gt; users</code> that contains a few user objects.</p>
  
  <pre><code>public class User
  {
      int id;
      String name;
      String location;
  }
  </code></pre>
  
  <p>I want to put this ArrayList in a JList so it will display the users names -</p>
  
  <pre><code>John
  Mick
  Sam
  Joe
  </code></pre>
  
  <p>--- And when I select a user name an event is fired that lets me perform some action using the appropriate User object. So someone clicks 'Mick' and I get code like this (pseudocode) -</p>
  
  <pre><code>public jListClicked(User user)
  {
      int id = user.id;
      String name = user.name;
      String location = user.location;
  
      updateDatabase(id, name, location);
  }
  </code></pre>
  
  <p>I presume this is possible using a JList?? After all I imagine that is what the JList component was created for. So how do I add an object like ArrayList to a JList so I will have the above functionality?</p>