title: Removing specific Item from Jcombobox
body: <p>I am populating a combobox using a DefaultComboBoxModel and a custom Item.  Each item contains an id and a name.  I am iterating through a table, and based on a selection, I would like to remove selected elements from the combobox.  For the items I want to remove, I have the ID and Name from the table I am iterating through.  I have tried using removeItem which takes in an object.  I pass the ID and Name into my custom Item constructor, but that does not seem to work.  Can anyone tell me what I am missing here?</p>
  
  <p>Code for populating combobox:</p>
  
  <pre><code>Vector&lt;Object&gt; companyList = new Vector&lt;Object&gt;();
          while(rs.next()){
              companyList.addElement(new Item(rs.getInt(1),rs.getString(2)));
          }
  DefaultComboBoxModel cmod = new DefaultComboBoxModel(companyList);
          companyName.setModel(cmod);
  </code></pre>
  
  <p>Code for custom Item:</p>
  
  <pre><code>class Item
  {
      private int id;
      private String name;
  
      public Item(int id, String name)
      {
          this.id = id;
          this.name = name;
      }
  
      public int getId()
      {
          return id;
      }
  
      public String getName()
      {
          return name;
      }
  
      public String toString()
      {
          return name;
      }
  }
  </code></pre>
  
  <p>Code for removing Item (hard-coded for this example):</p>
  
  <pre><code> companyName.removeItem(new Item(50002,"ALLIED WASTE SYSTEMS"));
  </code></pre>
  
  <p>removeItem says it takes in an Object so I am not sure why this won't work.  Any help would be appreciated!</p>