private boolean isNumber(String string){
  String s=string.trim();
  if (s.length() < 1)   return false;
  double value=0;
  try {
    value=Double.parseDouble(s);
  }
 catch (  NumberFormatException e) {
    return false;
  }
  return true;
}

private boolean isNumber ( String string ) { String s = string . trim ( ) ; if ( s . length ( ) < 1 ) return false ; double value = 0 ; try { value = Double . parseDouble ( s ) ; } catch ( NumberFormatException e ) { return false ; } return true ; }
tell whether the string contains a number .
