valueClass = getFormattedTextField().getValue().getClass();
{ JFormattedTextField jft = getFormattedTextField(); if (jft != null) valueClass = jft.getValue().getClass(); }
  public Object stringToValue(String string)    throws ParseException  {    Object value = string;    Class valueClass = getValueClass();    if (valueClass == null)      valueClass = getFormattedTextField().getValue().getClass();    if (valueClass != null)      try        {          Constructor constr = valueClass.getConstructor                                             (new Class[]{String.class});          value = constr.newInstance(new Object[]{ string });        }      catch (NoSuchMethodException ex)        {          // leave value as string        }      catch (Exception ex)        {          throw new ParseException(string, 0);        }    return value;  }