title: JComboBox setSelectedItem does not work
body: <p>I am trying to set the <code>setSelectedItem</code> of the <code>JComboBox</code> in the constructor of my <code>JPanel</code> class just after populating the combobox.</p>
  
  <p>I am set the value for textbox, but I can't figure out why <code>setSelectedItem</code> does not seem to work. Any ideas?</p>
  
  <pre><code>public StudentProfilePanel(StudentInfo si) {
  
          yesButton.setBounds(50, 346, 69, 40);
          noButton.setBounds(121, 346, 56, 40);
          this.add(yesButton);
          this.add(noButton);
          setLayout(null);
          comboBoxYear.setModel(new DefaultComboBoxModel(years()));
          comboBoxYear.setBounds(202, 365, 62, 23);
          if(si.birthdate!=null){
              //System.out.println("year value : ["+dateofbirth(si.birthdate)[2]+"]");
              comboBoxYear.setSelectedItem(dateofbirth(si.birthdate)[2]);
  
          }
  
          add(comboBoxYear);
          comboBoxMonth.setModel(new DefaultComboBoxModel(new String[]{"01","02","03","04","05","06","07","08","09","10","11","12"}));
          comboBoxMonth.setBounds(285, 365, 56, 23);
  
          //set month value
          if(si.birthdate!=null){
              //comboBoxMonth.setSelectedItem(dateofbirth(si.birthdate)[1]);
              comboBoxMonth.setSelectedItem("04");
              System.out.println("month value : ["+dateofbirth(si.birthdate)[1]+"]");
          }
          add(comboBoxMonth);
          comboBoxDay.setModel(new DefaultComboBoxModel(days()));
          comboBoxDay.setBounds(351, 365, 54, 23);
          if(si.birthdate!=null){
              //comboBoxDay.setSelectedItem(dateofbirth(si.birthdate)[0]);
              comboBoxDay.setSelectedItem(dateofbirth(si.birthdate)[0]);
          }
          add(comboBoxDay);
  
          textFieldFirstName = new JTextField();
          textFieldFirstName.setBounds(21, 321, 171, 21);
          add(textFieldFirstName);
          textFieldFirstName.setColumns(10);
          // set the value of first name
          textFieldFirstName.setText(si.firstName);
  
          textFieldLastName = new JTextField();
          textFieldLastName.setBounds(242, 321, 163, 21);
          add(textFieldLastName);
          textFieldLastName.setColumns(10);
          //set the value of the last name
          textFieldLastName.setText(si.lastName);
  
          JPanel panelPersonPhoto = new ImagePanel(
                  "C:\\Users\\MDJef\\Pictures\\Wallpaper\\General\\11.jpg");
          panelPersonPhoto.setBorder(new TitledBorder(null, "",
                  TitledBorder.LEADING, TitledBorder.TOP, null, null));
          panelPersonPhoto.setBounds(21, 20, 384, 291);
          add(panelPersonPhoto);
      }
  </code></pre>
  
  <p>Thanks very much.</p>
  
  <p>helper methods that I used</p>
  
  <pre><code>    // jf : helper method
      public String[] years() {
          String[] results = new String[90];
          for (int i = 0; i &lt; 90; i++) {
              results[i] = Integer.toString(1900 + i);
          }
          return results;
      }
  
      // jf : helper method
      public String[] months() {
          String[] results = new String[12];
          for (int i = 0; i &lt; 12; i++) {
              results[i] = Integer.toString(i + 1);
          }
          return results;
      }
  
      // jf : helper method
      public String[] days() {
          String[] results = new String[31];
          for (int i = 0; i &lt; 31; i++) {
              results[i] = Integer.toString(i + 1);
          }
          return results;
      }
  
      // jf : helper method
      public String[] dateofbirth(String dob) {
          String[] tokens = dob.split("-");
          return tokens;
      }
  </code></pre>