title: Find selected item of a JList and display it in real time
body: <p>I have a <code>JList</code>, where i am displaying some ID's. I want to capture the ID the user clicked and dis play it on a <code>JLabel</code>.</p>
  
  <pre><code>String selected = jlist.getSelectedItem().toString();
  </code></pre>
  
  <p>The above code gives me the selected <code>JList</code> value. But this code has to be placed inside a button event, where when i click the button it will get the JList value an assign it to the <code>JLabel</code>.</p>
  
  <p>But, what i want to do is, as soon as the user clicks an item of the <code>JList</code> to update the <code>JLabel</code> in real time. (without having to click buttons to fire an action)</p>