javaatm程序设计文档内容摘要:

getPassword().setBounds(210,60,120,20)。 //(new MyActionListner())。 //(new MyActionListner())。 ///=========================== (getUsername())。 (getPassword())。 (fieldPanel,Center)。 JPanel buttonPanel = new JPanel()。 (new FlowLayout())。 (ok)。 (cancel)。 (buttonPanel,South)。 } public JTextField getUsername() { return username。 } public void setUsername(JTextField username) { = username。 } public JPasswordField getPassword() { return password。 } public void setPassword(JPasswordField password) { = password。 } class MyActionListner implements ActionListener { public void actionPerformed(ActionEvent arg0) { Object o=()。 if(o==ok) { long id = (getUsername().getText())。 String pass = getPassword().getText()。 // long id=100018。 // String pass=1。 bank=。 try { //(bank)。 currentId= (id, pass)。 //(currentId)。 new Business(currentId)。 ()。 } catch (LoginException e) { ()。 } } if(o==cancel) { new Wele()。 ()。 } } } } 4:如果注册了的用户就可以直接进行办理业务 package。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 public class Business{ public static long currentId。 private JFrame frame = new JFrame(业 务 )。 private Container c = ()。 private JButton cancel = new JButton(退出程序 )。 private JButton save = new JButton(存 款 )。 private JButton take = new JButton(取 款 )。 private JButton move = new JButton(转 款 )。 private JButton queryMoney = new JButton(查询余额 )。 private JButton queryHistroy = new JButton(查询历史记录 )。 private JButton back = new JButton(返回主界面 )。 public Business(long currentId){ =currentId。 (800,600)。 (new BorderLayout())。 (true)。 JPanel titlePanel = new JPanel()。 (new FlowLayout())。 (new JLabel(SUNNY 银行办理业务界面 ))。 (titlePanel,North)。 (new MyActionListner())。 (new MyActionListner())。 (new MyActionListner())。 (new MyActionListner())。 (new MyActionListner())。 (new MyActionListner())。 (new MyActionListner())。 JPanel buttonPanel = new JPanel()。 (null)。 (100, 70, 120, 40)。 (300, 70, 120, 40)。 (500, 70, 120, 40)。 (200, 170, 120, 40)。 (400, 170, 120, 40)。 //(200, 400, 120, 40)。 (450, 400, 120, 40)。 (600, 170, 120, 40)。 //(ok)。 (cancel)。 (save)。 (take)。 (queryMoney)。 (queryHistroy)。 (move)。 (back)。 (buttonPanel,Center)。 } class MyActionListner implements ActionListener { public void actionPerformed(ActionEvent arg0) { Object o=()。 if(o==cancel) { ()。 } if(o==save) { //currentId=。 new Savemoney(currentId)。 //(currentId)。 ()。 } if(o==take) { new Takemoney(currentId)。 ()。 } if(o==queryMoney) { new Query(currentId)。 ()。 } if(o==queryHistroy) { new QueryHistory(currentId)。 ()。 } if(o==move) { new Move(currentId)。 ()。 } if(o==back) { new Wele()。 ()。 } } } } 5:如果要存款的用户可以点击存款进行存钱 package。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 public class Savemoney { public static long currentId。 private JFrame frame = new JFrame(存钱 )。 private Container c = ()。 private JTextField username = new JTextField()。 private JButton ok = new JButton(确定 )。 private JButton cancel = new JButton(取消 )。 private Bank bank。 //private long currentId。 public Savemoney(Bank bank) { (bank)。 } public Bank getBank() { return bank。 } public void setBank(Bank bank) { = bank。 } //public long getCurrentId() { // return currentId。 //} // //public void setCurrentId(long currentId) { // = currentId。 //} public Savemoney(long currentId){ =currentId。 (500,500)。 (new BorderLayout())。 (true)。 JPanel titlePanel = new JPanel()。 (new FlowLayout())。 (new JLabel(存款 ))。 (titlePanel,North)。 JPanel fieldPanel = new JPanel()。 (null)。 JLabel l1 = new JLabel(存入金额 :)。 (80, 20, 80, 20)。 (l1)。 (210,20,120,20)。 (username)。 (fieldPanel,Center)。 (new MyActionListner())。 (new MyActionListner())。 JPanel buttonPanel = new JPanel()。 (new FlowLayout())。 (ok)。 (cancel)。 (buttonPanel,South)。 } public JTextField getUsername() { return username。 } public void setUsername(JTextField username) { = username。 } class MyActionListner implements ActionListener { public void actionPerformed(ActionEvent arg0) { Object o=()。 if(o==ok) { bank=。 double money =(getUsername().getText())。 //double money = 100。 //currentId=。 //(currentId)。 (currentId, money)。 new Business(currentId)。 ()。 } if(o==cancel) { new Business(currentId)。 ()。 } } } } 6:如果要取钱的用户可以点击取款 package。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 public class Takemoney { public static long currentId。 private JFrame frame = new JFrame(取钱 )。 private Container c = ()。 private JTextField username = new JTextField()。 //private JPasswordField password = new JPasswordField()。 private JButton ok = new JButton(确定 )。 private JButton cancel = new JButton(取消 )。 private Bank bank。 public Takemoney(Bank bank) { (bank)。 } public Bank getBank() { return bank。 } public void setBank(Bank bank) { = bank。 } public Takemoney(long cu。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。