您的位置:首页 > 其它

try catch可以这么用:校验!

2014-12-05 16:41 375 查看
try {
int qtel = Integer.parseInt(certQtyTextField.getText());
if (qtel > 10 || qtel < 1) {
MessageBox.warn("数量,请填写1-10之间的数字!");
return;
}
} catch (Exception e) {
MessageBox.warn("数量,请填写1-10之间的数字!");
return;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: