怎么判断text框里的文字是否为数值? use Double.parseDouble(String s). if there is no exception, that is a number. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String s=JTextField.getText();try {Double.parseDouble(s);System.out.println("是数字!");} catch(Exception e) {System.err.println("不是数字!");} beyond_xiruo gave the good example. that is what i want to say. thanks 求socket代码 java 泛型 接口问题! 问一个字符串分割 如何创建自定义的java包 Tomcat问题 java编译器 菜鸟求救 哥哥姐姐们帮帮忙哦, 新手面对JB7,一筹莫展。 静态方法使用的问题 JBuilder7里的jdbNavToolBar怎么做?
try {
Double.parseDouble(s);
System.out.println("是数字!");
} catch(Exception e) {
System.err.println("不是数字!");
}