public static boolean isNumeric(String str){ try { Integer.parseInt(str); return true; } catch (NumberFormatException e) { // TODO Auto-generated catch block return false; } }