我需要做的是提示用户输入用户名和密码(身份验证在本地完成),如果签出,用户就可以访问主程序主体。如何在进入主程序之前提示用户输入密码?
public static void main(String[] args){
//String input = JOptionPane.showInputDialog("Enter password to continue: ");
//input2 = Integer.parseInt(input);
// followed by the creation of the main frame
new Cashier3();
Cashier3 frame = new Cashier3();
frame.setTitle("CASHIER 2");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
有没有什么快捷的方法去做到这一点?
这使的感觉很多。我没有真正触及过静态块,直到现在从未真正看到过需要。谢谢,这使得它更清晰。 – user976123 2012-02-02 05:52:33
@ user976123:您的欢迎,很高兴我能帮上忙。问候 – 2012-02-02 05:55:22