title: JComboBox modify index using DefaultComboBoxModel
body: <p>I have created a <code>JComboBox</code> and populated its content from database using <code>DefaultComboBoxModel</code>.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>DefaultComboBoxModel model = new DefaultComboBoxModel();
  PreparedStatement statement = con.prepareStatement("SELECT _fid, fruit_name FROM fruits;");
  
  ResultSet result = statement.executeQuery();
  while (result.next()) {
      model.addElement(result.getString(2));
  }
  comboBox = new JComboBox(model);
  </code></pre>
  
  <p>How can I also set the index of the <code>JComboBox</code> with the value of <code>_fid</code>?</p>
  
  <p>I'm fairly new to Java &amp; MySQL and right now I don't have a working idea.</p>