UNB/ CS/ David Bremner/ teaching/ java/ catch3.java
public void keypressCallback(String str){
  if (str.length()==1 && '0'<=str.charAt(0) &&
      str.charAt(0)<='9' || str.charAt(0)=='.'){
      try{
        String newVal=(input.getStr() + str);
        BigDecimal test=new BigDecimal(newVal);
        input.setStr(newVal);
      }
      catch (NumberFormatException e){  }
  } else{
    client.numberPadCallback(str);
  }
}//