弹出消息框

6 浏览
0 Comments

弹出消息框

我不确定如何在我的方法中编写弹出消息框的代码。

public String verify(){

String result = "failed";

int authcode = staffBean.getVerifyCodeByName(getLoginUserName());

if (code == authcode){

result ="success";

}

else{ //弹出错误消息框的语句

}

return result;

}

我已尝试在我的方法中使用JOptionPane,但它不起作用:

String st = "欢迎";

JOptionPane.showMessageDialog(null, st);

0