title: Java ComboBox Different Value to Name
body: <p>I have a Java combo box and a project linked to an SQLite database. If I've got an object with an associated ID and name:</p>
  
  <pre><code>class Employee {
      public String name;
      public int id;
  }
  </code></pre>
  
  <p>what's the best way of putting these entries into a JComboBox so that the user sees the name of the employee but I can retreive the employeeID when I do:</p>
  
  <pre><code>selEmployee.getSelectedItem();
  </code></pre>
  
  <p>Thanks</p>