你的写法有些问题:我一般这样写:
public Boolean isInt(String str){
  str=str.trim();
  try{
     int int_out=Integer.parseInt(str);
    }catch(NumberFormatException e){
       return false;
    }
  return true;
}