title: How do you edit an element by index in a JList?
body: <p>How to set the text/name of a <code>JList</code> element in Java Swing?</p>
  
  <p>I have created a list with 5 list elements.</p>
  
  <p>When I do:</p>
  
  <pre><code>int currentIndex = list.getSelectedIndex();
  </code></pre>
  
  <p>I take the index of the current element.
  I would like to edit/modify the Text of the current element index.
  Is there any method for that?</p>
  
  <p>e.g. </p>
  
  <pre><code>list.setText(CurrentIndex,"new text")
  </code></pre>