title: Set items to Combo Box in JAVA
body: <p>I have a combo box with options Small, Medium, and Large. These are the properties and want to apply...</p>
  
  <p>The string variable <code>Pattern</code> have values <code>Small</code>, <code>Medium</code>, <code>Large</code> and it's add to the combo box <code>Barsize</code></p>
  
  <p>While running this java file, if I choose <code>Medium</code> option it got selected and also property had applied but if I run once again it goes to Small option in index of the combo box.</p>
  
  <p>How do I save that....???
  I need an option what I have selected in index till Next changes will make... </p>
  
  <p>Coding is........</p>
  
  <pre><code>propertiesPanel.add(new JLabel("Barsize"))
  BarField = new JComboBox(pattern)
  propertiesPanel.add(BarField)
  </code></pre>
  
  <p>Here pattern have the values <code>Small</code>, <code>Medium</code>, and <code>Large</code>......</p>