import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class ATM extends JFrame {
    private JLabel logoLabel = new JLabel("Bruin Bank");
    private JPanel eastPanel = new JPanel(new GridLayout(0,1));
    private JPanel westPanel = new JPanel(new GridLayout(0,1));
    private JPanel centerPanel = new JPanel(new BorderLayout());
    private JPanel numPanel = new JPanel(new GridLayout(4,3));
    private JTextArea infoTextArea = new JTextArea(7,0);
    private JButton[] numButton = new JButton[10];
    private JTextField numTextField = new JTextField();
    
    private JRadioButton withdrawButton = new JRadioButton("Withdraw");
    private JRadioButton depositButton = new JRadioButton("Deposit");
    private JRadioButton balanceButton = new JRadioButton("Balance");
    
    private JButton proceedButton = new JButton("Proceed");
    private JButton cancelButton = new JButton("Cancel");
    private JButton exitButton = new JButton("Exit");
    private String name;
    private int balance;
   
    
    public ATM(String name, int balance) {
        this.name = name;
        this.balance = balance;

        //  for center panel
        getContentPane().add(centerPanel);
        
        
        // for east panel
        eastPanel.add(proceedButton);
        eastPanel.add(cancelButton);
        eastPanel.add(exitButton);
        getContentPane().add(eastPanel, BorderLayout.EAST);
        
        // for west panel
        westPanel.add(depositButton);
        westPanel.add(withdrawButton);
        westPanel.add(balanceButton);
        getContentPane().add(westPanel, BorderLayout.WEST);
        
     
        getContentPane().add(logoLabel, BorderLayout.NORTH);
        getContentPane().add(infoTextArea, BorderLayout.SOUTH);
    }
    

    // in below are a list of messages 
    private String welcomeMessage() {
        return "Hi " + name + "\nWelcome to Bruin Bank";
    }
    
    private String balanceMessage() {
        return "Balance : $" + balance;
    }
    
    private String depositHelpMessage() {
        return "Please enter the deposit amount.\nPress the proceed button when you are ready.";
    }
    
    private String withdrawHelpMessage() {
        return "Please enter the withdraw amount.\nPress the proceed button when you are ready.";
    }
    
    
    private String negativeInputMessage() {
        return "Sorry, the transaction cannot be completed.\nPlease enter a positive number.";
    }
    
    private String errorInputMessage() {
        return "Sorry, the transaction cannot be completed because the input is incorrect.";
    }
    
    private String transactionCompleteMessage() {
        return "The transaction is completed";
    }
    
    private String notEnoughAmountMessage() {
        return "Sorry, the transaction cannot be completed because there is not enough money for the withdrawl.";
    }
    
    private String cancelMessage() {
        return "Action cancelled.";
    }
    
    // you have to change the main
    // so that 
    // C:> java ATM name balance 
    // show up an ATM with given name and balance
    public static void main(String[] args) {
        ATM atm = new ATM("Charles Li", 1000);
	atm.setSize(450,400);
	atm.setVisible(true);
	atm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
