title: Upgrade the Items of JCombobox
body: <p>I want to upgrade the list items of myComboBox when I click a row in myJtabel. I did what I must do to have a good result. But when a unpgrade myComboBox I have a true as a last item and every time I have done an upgrade adds a true as item</p>
  
  <p>What it does not go in my class</p>
  
  <p>myUpgradeCombo :</p>
  
  <pre><code>    class myUpgradeCombo {
  
  public static &lt;E&gt; void upgrade_(JComboBox&lt;E&gt; combo, int index)
      {
          E item = combo.getItemAt(index);
          combo.removeItemAt(index);
          combo.insertItemAt(item, 0);
          combo.setSelectedIndex(0);
      }
  
      public static &lt;E&gt; boolean upgrade(JComboBox&lt;E&gt; combo, E item)
      {
          for (int index=0; index&lt;combo.getItemCount(); index++)
          {
              if (combo.getItemAt(index).toString().equals(item.toString()))
              {
                  upgrade_(combo,index);
  
                  return true;
              }
          }
           return false ;
      }
  }
  </code></pre>
  
  <p>when myJtable Mouse pressed :</p>
  
  <pre><code>    int rec = myJtableF.getSelectedRow();
  String idf = myJtableF.getValueAt(rec, 1).toString();
  String format = myJtableF.getValueAt(rec, 2).toString();
  String platef = myJtableF.getValueAt(rec, 3).toString(); 
  this.myCombo.addItem(myUpgradeCombo.upgrade(myCombo, new FC(format,platef,idf)));
  </code></pre>
  
  <p>As result in myCombo : </p>
  
  <pre><code>...... MySelectedItem
  .......Firstitem
  .......SecondItem
  .......ThirdItem
  .......fourthItem
  .......true
  .......true
  </code></pre>
  
  <p>Thanks,</p>