title: Why do JList selections occur twice?
body: <p>I have a JList with some items. I've added a listener for when a item in the list is selected. Here is the code for what happens when an item in the list is selected:</p>
  
  <pre><code>private void questionaireNamesListValueChanged(ListSelectionEvent evt) {
      try {
          inputPanel.setEnabled(false);
          inputPanel.setVisible(false);
          inputTextField.setText("");
          inputStatusLabel.setText("");
          int questionaireIndex = questionaireNamesList.getSelectedIndex();
  
          // Why will this be printed twice?
          System.out.println("Questionaire Index: " + questionaireIndex);
  
          if (remoteQuestionServer.getQuestionCount(questionaireIndex) == 5) {
              answerQuestionButton.setEnabled(true);
              addQuestionButton.setEnabled(false);
          } else {
              addQuestionButton.setEnabled(true);
              answerQuestionButton.setEnabled(false);
          }
      } catch (RemoteException ex) {
          ex.printStackTrace();
      }
  } 
  </code></pre>
  
  <p>As you can above I put a <code>System.out.print</code> statement in and every time I click on something in the list I get two ouputs for that item, eg.</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>Questionaire Index: 4
  Questionaire Index: 4
  Questionaire Index: 2
  Questionaire Index: 2
  Questionaire Index: 0
  Questionaire Index: 0
  Questionaire Index: 2
  Questionaire Index: 2
  </code></pre>
  
  <p>Any idea why this is happening?</p>
  
  <p>Thanks,
  Patrick</p>