value = new Integer(((JComboBox)comp).getSelectedIndex());
value = ((JComboBox)comp).getSelectedItem();
  public void setProperty(Component comp)  {    String name = (String)mappings.get(comp);    Object value = null;    if(comp instanceof JFormattedTextField)    {      try      {        value = ((JFormattedTextField)comp).getFormatter().stringToValue(((JFormattedTextField)comp).getText());      }      catch(ParseException e)      {        e.printStackTrace();        return;      }    }    else if(comp instanceof JTextField)    {      value = ((JTextField)comp).getText();    }    else if(comp instanceof JSpinner)    {      value = ((JSpinner)comp).getValue();    }    else if(comp instanceof JRadioButton)    {      JRadioButton button = (JRadioButton)comp;      if(!button.isSelected())        return;      value = button.getActionCommand();    }    else if(comp instanceof JCheckBox)    {      value = new Boolean(((JCheckBox)comp).isSelected());    }    else if(comp instanceof JList)    {      value = new Integer(((JList)comp).getSelectedIndex());    }    else if(comp instanceof JComboBox)    {      value = new Integer(((JComboBox)comp).getSelectedIndex());    }    LogFactory.getLog(this.getClass()).info("Set " + name + "=" + value);    if(source instanceof Map)    {      if(value == null)        ((Map)source).remove(name);      else        ((Map)source).put(name, value);    }    else    {      try      {        PropertyUtils.setProperty(source, name, value);      }      catch(IllegalArgumentException e)      {        try        {          PropertyUtils.setProperty(source, name, value.toString());        }        catch(Exception e1)        {          e1.printStackTrace();        }      }      catch(IndexOutOfBoundsException e)      {        LogFactory.getLog(this.getClass()).info("Unable to index into property " + name);      }      catch(Exception e)      {        e.printStackTrace();      }    }  }