?? bank.java
字號:
import javax.swing.JOptionPane;
class Bank
{
//類的字段
public int acctCount = 0;
public int userCount =0;
public Account account[] = new Account[1000];
public Userinfo users[] = new Userinfo[1000];
public void login( String accountNumber, String password )//登陸檢測方法
{
int i =0;
for(i = 0; i < acctCount; i++)
{
if((accountNumber.equals(account[i].getAccountNumber()))
&& (password.equals(account[i].getPassword())))
break;
}
if(i < acctCount)
{
ActionChoice oper = new ActionChoice(account[i], users[i]);
oper.setVisible(true);
}
else
{
JOptionPane.showMessageDialog(null,"卡號或則密碼有誤!");
}
}
public void registration( Account a1, Userinfo u1 )
{
account[acctCount] =a1;
users[userCount]= u1;
account[acctCount].setAccountNumber(String.valueOf(acctCount + 95588221));
String str ="卡號:"+account[acctCount].getAccountNumber() + " 密碼:"+account[acctCount].getPassword();
JOptionPane.showMessageDialog(null,str);
acctCount ++;
userCount ++;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -