title: How to get int value of selected item from JOptionPane?
body: <p>Is there a way to get the selected index of the selected item when using JOptionPane with a combobox?</p>
  
  <p>In the below code, I can get the Selected Value, but I need the selected index.</p>
  
  <pre><code>String input = (String) JOptionPane.showInputDialog(null, "Select Mechanic: ",
  "Select Mechanic", JOptionPane.QUESTION_MESSAGE, null, mechanics, mechanics[0]);
  </code></pre>
  
  <p>Is it possible to get the selected index with JOptionPane?</p>