title: Using a switch statement for a JComboBox
body: <p>I have a JComboBox set up as shown below:</p>
  
  <pre><code>private String[] boxChoices = {"option 1", "option 2"};
  JcomboBox box = new JCombobox(boxChoices);
  
  box.addItemListener()
  { 
      public void itemStateChanged(ItemEvent event)  
      {
          int selection = box.getSelectedIndex();
          switch (selection)
          {
              case 0: JOptionPane.showMessageDialog(null, "you have selected option 1");
                  break;
              case 1: JOptionPane.showMessageDialog(null, "you have selected option 2");
                  break;
              default: break;
          }
      }
  }
  </code></pre>
  
  <p>My issue is that when I pick an option the message will be shown twice instead of once. For example if I choose Option 1 the following would appear:</p>
  
  <pre><code>you have selected option 1
  you have selected option 1
  </code></pre>
  
  <p>What is causing this to happen?</p>