Idle to have nothing to do, knock to play.
Code:
Package Atm;import java.awt.*;import java.awt.event.*;import javax.swing.*;p ublic class ATM extends JFrame implements ActionListener {private JPanel pan; private JPanel sec; private JButton log; static JLabel text1=new JLabel ("account"); static JLabel text2=new JLabel ("password"); Static JLabel text3=new JLabel ("deposit"); Static JLabel text4=new JLabel ("withdrawals"); Static JLabel text5=new JLabel ("balance"); Static JTextField account=new JTextField ("", 18); Static JTextField password=new JTextField ("", 18); Static JTextField savein=new JTextField ("", 12); Static JButton saveb=new JButton ("confirmation"); Static JTextField takeout=new JTextField ("", 12); Static JButton takeb=new JButton ("confirmation"); Static JTextField left=new JTextField ("", 12); static int money=10000; String zero=integer.tostring (0); String Acc=new string ("888888"); String Pas=new string ("888888"); ATM () {this.setbounds (400, 300, 260, 200); Pan = new JPanel (); Log = new JButton ("login"); Log.addactionlistener (this); This.add (PAN); This.setalwaysontop (TRUE); ThiS.setvisible (TRUE); Pan.add (Text1); Pan.add (account); Pan.add (TEXT2); Pan.add (password); Pan.add (log); This.settitle ("ATM");} public static void Main (String args[]) {new ATM ()}, public void actionperformed (ActionEvent e) {if (E.getsource () ==lo g) {String ac=account.gettext (); String Pa=password.gettext (); if (Ac.equals (ACC) &&pa.equals (PAS)) {this.setvisible (false); New another (); }}}class another extends jframe{another () {sec = new JPanel (); This.add (SEC); This.settitle ("ATM"); This.setbounds (400, 300, 260, 200); This.setvisible (TRUE); Sec.add (TEXT3); Sec.add (Savein); Sec.add (SAVEB); Sec.add (TEXT4); Sec.add (takeout); Sec.add (TAKEB); Sec.add (TEXT5); Sec.add (left); String m=integer.tostring (Money); Left.settext (M); left.seteditable (false); Savein.settext (zero); Takeout.settext ( zero); Saveb.addactionlistener (new ActionListener () {public void actionperformed(ActionEvent e) {String tmp=savein.gettext (); int val=integer.parseint (TMP); Savein.settext (zero); Takeout.settext (zero); if (val> 0) {money+=val; String m=integer.tostring (Money); Left.settext (M); left.seteditable (false); Joptionpane.showmessagedialog (NULL, "Deposit successful! "); } Else{joptionpane.showmessagedialog (NULL, "You Tease me!" "); }}}); Takeb.addactionlistener (new ActionListener () {public void actionperformed (ActionEvent e) {String Tmp=takeout.gettext ( ); int val=integer.parseint (TMP); Savein.settext (zero); Takeout.settext (zero); if (val>=0 && Val<=money && val%100==0) {money-=val; String m=integer.tostring (Money); Left.settext (M); left.seteditable (false); Joptionpane.showmessagedialog (NULL, "successful withdrawals! "); }else{joptionpane.showmessagedialog (NULL, "illegal operation! "); }}}); }}}
JAVA Retarded ATM