public static boolean isNumeric(String string) {
    String testString = string;
    if ((string.charAt(0) == '+') ||
    (string.charAt(0) == '-')) {
      if (string.length() > 1)
        testString = string.substring(1);
      else
        return false;
    }
    for (int i = 0; i < testString.length(); i++) {
      if (! Character.isDigit(testString.charAt(i)))
        return false;
    }
    return true;
  }