title: Wants to get selected index fron a JList. But returns -1
body: <p>I made a jlist and set a default list model using setModel method. When I called getSelectedIndex(), it returns -1. Why is it?</p>
  
  <pre><code>if (!listAdded.isSelectionEmpty()) {
          listModelAdded.removeElementAt(listAdded.getSelectedIndex());
          listBankQuestions.remove(listAdded.getSelectedIndex());
          System.out.println(i);
          --i;
          System.out.println("Selected : " + listAdded.getSelectedIndex());
  }
  </code></pre>