Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

I have written an ATM GUI but I am having issues with some of the

I have written an ATM GUI but I am having issues with some of the

code. Could someone please review my code and point out my errors? Thanks again. Attached are the requirements (instructions) and my code. Any help would be much appreciated. It looks as if the AtmGui.java file has all the errors, whereas the other 2 files appear good to go. I think the issue is with my two account objects (checking and savings) in the AtmGui.java but I am at a stand still at the moment. I am using NetBeans to write and compile the code. Any feedback is appreciated.

package my.project2;import java.awt.*;import java.awt.event.*;import javax.swing.*;/*** File: Accounts.java* Author:* Date: April 5, 2017* Purpose: Gives gives functions to the ATM GUI buttons.*/class Accounts extends JFrame {// Variablesprivate JButton withdrawButton;private JButton depositButton;private JButton transferButton;private JButton balanceButton;private JRadioButton chRadioButton;private JRadioButton savRadioButton;private JTextField inputTexField;private ButtonGroup accounts;private double cashChecking = 0;private double cashSavings = 0;private String chk;private String sav;private double temp1;private int countSur = 0;private double cashSur = 1.5;// ATM GUI constructorpublic Accounts(String AtmGui) {super(AtmGui);this.setLocationRelativeTo(null); //Invoke JFrame constructorsetLayout(new FlowLayout()); //sets layout manager// Withdraw ButtonwithdrawButton = new javax.swing.JButton(“Withdraw”);add(withdrawButton);// Adds amplifying info to button when cursor hovers over buttonwithdrawButton.setToolTipText(“Withdraws money from selected account”);// Deposit ButtondepositButton = new javax.swing.JButton(“Deposit”);add(depositButton);// Adds amplifying info to button when cursor hovers over buttondepositButton.setToolTipText(“Deposits money to selected account”);// Transfer ButtontransferButton = new javax.swing.JButton(“Transfer”);add(transferButton);// Adds amplifying info to button when cursor hovers over buttondepositButton.setToolTipText(“Transfers money to selected account”);// Balance ButtonbalanceButton = new javax.swing.JButton(“Balance”);add(balanceButton);// Adds amplifying info to button when cursor hovers over buttonbalanceButton.setToolTipText(“Displays current balance of “+ “selected account”);accounts = new javax.swing.ButtonGroup();
Background image of page 1
// Checking radio buttonchRadioButton = new javax.swing.JRadioButton(“Checking”);accounts.add(chRadioButton);add(chRadioButton);// Adds amplifying info to button when cursor hovers over buttonchRadioButton.setToolTipText(“Selects Checking Account”);// Savings radio buttonsavRadioButton = new javax.swing.JRadioButton(“Savings”);accounts.add(savRadioButton);add(savRadioButton);// Adds amplifying info to button when cursor hovers over buttonsavRadioButton.setToolTipText(“Selects Savings Account”);// Input Text FieldinputTexField = new javax.swing.JTextField();add(inputTexField);inputTexField.setColumns(7);inputTexField.setToolTipText(“Enter money amount here”);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// Action listener classbuttonMath doMath = new buttonMath();withdrawButton.addActionListener(doMath);depositButton.addActionListener(doMath);transferButton.addActionListener(doMath);balanceButton.addActionListener(doMath);chRadioButton.addActionListener(doMath);savRadioButton.addActionListener(doMath);inputTexField.addActionListener(doMath);}private class buttonMath implements ActionListener {@Overridepublic void actionPerformed(ActionEvent event) {// Check for Savings Radio Button Selected// Performs math based on user inputs and buttons selected.// Number must be a multiple of 20if(savRadioButton.isSelected()) {// Withdraw from Savingsif(event.getActionCommand().equals(“Withdraw”)){try {String text = inputTexField.getText();temp1 = Double.parseDouble(text);// Makes sure amount is multiple of 20// Withdraws if trueif(temp1 % 20 == 0 && cashSavings > temp1) {cashSavings -= temp1;countSur++;if(countSur == 4 && cashSavings < cashSur) {// Displays Insufficient FundsJOptionPane.showMessageDialog(null,“Insufficent Funds”);cashSavings += temp1;// Charges $1.50 fee}else if (countSur == 4) {cashSavings = cashSur;JOptionPane.showMessageDialog(null,“$1.50 Transfer Fee hass been “+ “charged to Current Account”);
Background image of page 2

Show 

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"