use Double.parseDouble(String s). if there is no exception, that is a number. 

解决方案 »

  1.   

    String s=JTextField.getText();
    try {
    Double.parseDouble(s);
    System.out.println("是数字!");
    } catch(Exception e) {
    System.err.println("不是数字!");
    }
      

  2.   

    beyond_xiruo gave the good example. that is what i want to say. thanks