Java tutorial
//package com.java2s; public class Main { /** * Check number. * * @param value * the value * @return true, if successful */ public static boolean checkNumber(String value) { try { if (value == null || value.length() == 0) { return false; } Float.parseFloat(value); } catch (NumberFormatException nfe) { return false; } return true; } }