title: Validate JList Before Selection Occur
body: <p>Currently, I have a JList listen to list selection listener.</p>
  
  <pre><code>private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {
      // When the user release the mouse button and completes the selection,
      // getValueIsAdjusting() becomes false        
      if (evt.getValueIsAdjusting()) {
          /*
            In certain situation, I may want to prevent user from selecting other
            than current selection. How can I do so?
          */
      }
  }
  </code></pre>
  
  <p>In certain situation, I may want to prevent user from selecting other than current selection. How can I do so?</p>
  
  <p>It seems too late when I receive ListSelectionEvent. But, if I want to do it before ListSelectionEvent happen, I do not know that user is trying to select other.</p>
  
  <p>Here is one of the senario.</p>
  
  <p><em>The JList is contains list of project name.
  So, whenever user select new list item, we need to turn the View, from current project, and display new project.
  However, current project may be unsaved yet.
  Hence, if current project unsaved yet, we will ask for user confirmation, "Save Project?" (Yes, No, Cancel)
  When user select cancel, this means he want to cancel his "select to another project" action. He want to stick with current JList selection.
  We will pop up the confirmation dialog box in jList1ValueChanged event handle.
  But when we try to stick with current JList selection, it is already too late.</em></p>