((JComboBox)comp).setSelectedIndex(Integer.parseInt(value.toString()));
((JComboBox)comp).setSelectedItem(value);
  public void getProperty(Component comp)  {    try    {      String name = (String)mappings.get(comp);      if(name == null)        return;      Object value;      if(source instanceof Map)      {        value = ((Map)source).get(name);      }      else      {        //if we try to index into a non-existent property, just set it to null        try        {          value = PropertyUtils.getProperty(source, name);        }        catch(IndexOutOfBoundsException ex)        {          value = null;        }      }      //         LogFactory.getLog(this.getClass()).info("Get " + name + "=" + value);      if(comp instanceof JFormattedTextField)      {        if(value == null)        {          ((JFormattedTextField)comp).setText("");        }        else          ((JFormattedTextField)comp).setValue(value);      }      else if(comp instanceof JTextField)      {        if(value == null)          value = "";        ((JTextField)comp).setText(value.toString());      }      else if(comp instanceof JSpinner)      {        if(value != null)          ((JSpinner)comp).setValue(value);      }      else if(comp instanceof JRadioButton)      {        if(value == null)          value = Boolean.FALSE;        if(((JRadioButton)comp).getActionCommand().equals(value.toString()))          ((JRadioButton)comp).setSelected(true);      }      else if(comp instanceof JCheckBox)      {        if(value == null)          value = Boolean.FALSE;        ((JCheckBox)comp).setSelected(new Boolean(value.toString()).booleanValue());      }      else if(comp instanceof JList)      {        if(value == null)          value = "0";        ((JList)comp).setSelectedIndex(Integer.parseInt(value.toString()));      }      else if(comp instanceof JComboBox)      {        if(value == null)          value = "0";        ((JComboBox)comp).setSelectedIndex(Integer.parseInt(value.toString()));      }      else if(comp instanceof JLabel)      {        if(value == null)          value = "";        ((JLabel)comp).setText(value.toString());      }    }    catch(Exception e)    {      e.printStackTrace();    }  }