对于使用带有消息对话框弹出框的客户端验证为空的文本字段,您如何对其进行integer
编码double
?
我实现了String empname
但是我似乎无法弹出一个对话框empid
,payrate
任何建议将不胜感激。
String empname = jtfEname.getText();
//If no text is entered display pop up dialog box.
if(empname.length()==0)
JOptionPane.showMessageDialog(null, "Please Enter Your Name");
int empid = Integer.parseInt(jtfEid.getText().trim());
//If no id is entered display pop up dialog box.
if (empid.equals(""))
JOptionPane.showMessageDialog(null, "Please Enter Your Id");
double payrate = Double.parseDouble(jtfPayRate.getText().trim());
//If no payrate is entered display pop up dialog box
if (payrate.equals(""))
JOptionPane.showMessageDialog(null, "Please Enter Your Pay Rate");