title: Java how to SetSelectedItem the ComboBox if from database?
body: <p>I have tried this, but failed. if I set manually the ComboBox from properties, I can set the selected item to that one.</p>
  
  <pre><code>cbSetNoInvoice.setSelectedItem(txtSearchAll.getText());
  </code></pre>
  
  <p>and this one is for load the listComboBox</p>
  
  <pre><code>for (Transaction tr : listTransaction) {
  cbSetNoInvoice.addItem(tr.getNo_invoice());
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/4RI0E.jpg" rel="nofollow">Here is the screenshot. I want to set the selected item on the "Invoice" combobox if user input on the textfield and click the button</a></p>