Aidez-moi avec les erreurs dans ce code SVP!

6rillo Messages postés 1 Date d'inscription vendredi 2 mars 2018 Statut Membre Dernière intervention 2 mars 2018 - 2 mars 2018 à 13:40
Whismeril Messages postés 19029 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 26 avril 2024 - 2 mars 2018 à 16:39
/*
  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
  • /

package ATM_Systems;

import java.awt.event.KeyEvent;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
*
  • @author user
  • /

public class ATMS extends javax.swing.JFrame {

/**
  • Creates new form ATMS
  • /

public ATMS() {
initComponents();
}

/**
  • This method is called from within the constructor to initialize the form.
  • WARNING: Do NOT modify this code. The content of this method is always
  • regenerated by the Form Editor.
  • /

@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jbtnWithdraw = new javax.swing.JButton();
jbtnBalance = new javax.swing.JButton();
jPanel4 = new javax.swing.JPanel();
jBtnLoan = new javax.swing.JButton();
jbtnDeposit = new javax.swing.JButton();
jPanel5 = new javax.swing.JPanel();
jbtn1 = new javax.swing.JButton();
jbtn2 = new javax.swing.JButton();
jbtnCancel = new javax.swing.JButton();
jbtn3 = new javax.swing.JButton();
jbtn4 = new javax.swing.JButton();
jbtn5 = new javax.swing.JButton();
jbtn6 = new javax.swing.JButton();
jbtnClear = new javax.swing.JButton();
jbtn7 = new javax.swing.JButton();
jbtn8 = new javax.swing.JButton();
jbtn9 = new javax.swing.JButton();
jbtnEnter = new javax.swing.JButton();
jButton13 = new javax.swing.JButton();
jbtnZero = new javax.swing.JButton();
jButton15 = new javax.swing.JButton();
jButton16 = new javax.swing.JButton();
jPanel6 = new javax.swing.JPanel();
jtxtDisplay = new javax.swing.JPanel();
jtxtDisplay1 = new javax.swing.JPanel();
jlblDisplay = new javax.swing.JLabel();
jlblLoan = new javax.swing.JLabel();
jlblBalance = new javax.swing.JLabel();
jlblWithdraw = new javax.swing.JLabel();
jlblDeposit = new javax.swing.JLabel();
jPanel7 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jtxtEnter = new javax.swing.JTextField();
jtxtnumberofyears = new javax.swing.JTextField();
jtxtlaonamount = new javax.swing.JTextField();
jtxtmonthlypayment = new javax.swing.JTextField();
jtxttotalpayment = new javax.swing.JTextField();
jPanel8 = new javax.swing.JPanel();
jtxtReceipt = new javax.swing.JPanel();
jLoanCal = new javax.swing.JButton();
jReset = new javax.swing.JButton();
jReceipt = new javax.swing.JButton();
jExit = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});

jPanel1.setPreferredSize(new java.awt.Dimension(1446, 754));

jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

jbtnWithdraw.setFont(new java.awt.Font("Cantarell", 1, 48)); // NOI18N
jbtnWithdraw.setText("-->");

jbtnBalance.setFont(new java.awt.Font("Cantarell", 1, 48)); // NOI18N
jbtnBalance.setText("-->");

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jbtnWithdraw, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtnBalance, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jbtnBalance, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jbtnWithdraw, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);

jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

jBtnLoan.setFont(new java.awt.Font("Cantarell", 1, 48)); // NOI18N
jBtnLoan.setText("<--");
jBtnLoan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnLoanActionPerformed(evt);
}
});

jbtnDeposit.setFont(new java.awt.Font("Cantarell", 1, 48)); // NOI18N
jbtnDeposit.setText("<--");

javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jBtnLoan, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(jbtnDeposit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(21, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jBtnLoan, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jbtnDeposit, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addGap(6, 6, 6))
);

jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

jbtn1.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn1.setText("1");
jbtn1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn1ActionPerformed(evt);
}
});

jbtn2.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn2.setText("2");
jbtn2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn2ActionPerformed(evt);
}
});

jbtnCancel.setBackground(new java.awt.Color(242, 42, 29));
jbtnCancel.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jbtnCancel.setForeground(new java.awt.Color(54, 46, 46));
jbtnCancel.setText("CANCEL");
jbtnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtnCancelActionPerformed(evt);
}
});

jbtn3.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn3.setText("3");
jbtn3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn3ActionPerformed(evt);
}
});

jbtn4.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn4.setText("4");
jbtn4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn4ActionPerformed(evt);
}
});

jbtn5.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn5.setText("5");
jbtn5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn5ActionPerformed(evt);
}
});

jbtn6.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn6.setText("6");
jbtn6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn6ActionPerformed(evt);
}
});

jbtnClear.setBackground(new java.awt.Color(247, 235, 42));
jbtnClear.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jbtnClear.setText("CLEAR");
jbtnClear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtnClearActionPerformed(evt);
}
});

jbtn7.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn7.setText("7");
jbtn7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn7ActionPerformed(evt);
}
});

jbtn8.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn8.setText("8");
jbtn8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn8ActionPerformed(evt);
}
});

jbtn9.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtn9.setText("9");
jbtn9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtn9ActionPerformed(evt);
}
});

jbtnEnter.setBackground(new java.awt.Color(60, 156, 22));
jbtnEnter.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jbtnEnter.setText("ENTER");
jbtnEnter.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtnEnterActionPerformed(evt);
}
});

jButton13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton13ActionPerformed(evt);
}
});

jbtnZero.setFont(new java.awt.Font("Cantarell", 1, 55)); // NOI18N
jbtnZero.setText("0");
jbtnZero.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtnZeroActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(jbtn1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtn2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtn3, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(jbtn4, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtn5, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtn6, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtnClear, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(jbtn7, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtn8, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtn9, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtnEnter, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jbtnZero, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(22, Short.MAX_VALUE))
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jbtn1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtn2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtn3, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(6, 6, 6)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jbtn4, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtn5, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtn6, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtnClear, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(6, 6, 6)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jbtn7, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtn8, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtn9, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtnEnter, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(6, 6, 6)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbtnZero, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(17, Short.MAX_VALUE))
);

jPanel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

jtxtDisplay.setBackground(new java.awt.Color(204, 255, 204));
jtxtDisplay.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 0));
jtxtDisplay.setFont(new java.awt.Font("Cantarell", 1, 14)); // NOI18N

jtxtDisplay1.setBackground(new java.awt.Color(204, 255, 204));
jtxtDisplay1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 255, 204)));
jtxtDisplay1.setFont(new java.awt.Font("Cantarell", 1, 14)); // NOI18N

jlblDisplay.setFont(new java.awt.Font("Open Sans", 1, 24)); // NOI18N
jlblDisplay.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jlblDisplay.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
jlblDisplay.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jlblDisplayPropertyChange(evt);
}
});

jlblLoan.setFont(new java.awt.Font("Cantarell", 1, 12)); // NOI18N
jlblLoan.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jlblLoan.setText("LOAN");

jlblBalance.setFont(new java.awt.Font("Cantarell", 1, 12)); // NOI18N
jlblBalance.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jlblBalance.setText("BALANCE");

jlblWithdraw.setFont(new java.awt.Font("Cantarell", 1, 12)); // NOI18N
jlblWithdraw.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jlblWithdraw.setText("WITHDRAW");

jlblDeposit.setFont(new java.awt.Font("Cantarell", 1, 12)); // NOI18N
jlblDeposit.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jlblDeposit.setText("DEPOSIT");

javax.swing.GroupLayout jtxtDisplay1Layout = new javax.swing.GroupLayout(jtxtDisplay1);
jtxtDisplay1.setLayout(jtxtDisplay1Layout);
jtxtDisplay1Layout.setHorizontalGroup(
jtxtDisplay1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jtxtDisplay1Layout.createSequentialGroup()
.addComponent(jlblBalance, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
.addComponent(jlblLoan, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jtxtDisplay1Layout.createSequentialGroup()
.addComponent(jlblWithdraw, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jlblDeposit, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jlblDisplay, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jtxtDisplay1Layout.setVerticalGroup(
jtxtDisplay1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jtxtDisplay1Layout.createSequentialGroup()
.addContainerGap(18, Short.MAX_VALUE)
.addGroup(jtxtDisplay1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jlblLoan, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jlblBalance, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jlblDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jtxtDisplay1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jlblDeposit, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jlblWithdraw, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(11, 11, 11))
);

javax.swing.GroupLayout jtxtDisplayLayout = new javax.swing.GroupLayout(jtxtDisplay);
jtxtDisplay.setLayout(jtxtDisplayLayout);
jtxtDisplayLayout.setHorizontalGroup(
jtxtDisplayLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jtxtDisplay1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
jtxtDisplayLayout.setVerticalGroup(
jtxtDisplayLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jtxtDisplay1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);

javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jtxtDisplay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jtxtDisplay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);

jPanel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

jLabel1.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jLabel1.setText("Interest rate");

jLabel2.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jLabel2.setText("Number of years");

jLabel3.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jLabel3.setText("Amount of loan");

jLabel4.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jLabel4.setText("Monthly payment");

jLabel5.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
jLabel5.setText("Total payment");

jtxtEnter.setBackground(new java.awt.Color(255, 255, 255));
jtxtEnter.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jtxtEnter.setHorizontalAlignment(javax.swing.JTextField.CENTER);
jtxtEnter.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jtxtEnterActionPerformed(evt);
}
});

jtxtnumberofyears.setBackground(new java.awt.Color(255, 255, 255));
jtxtnumberofyears.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jtxtnumberofyears.setHorizontalAlignment(javax.swing.JTextField.CENTER);
jtxtnumberofyears.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jtxtnumberofyearsKeyTyped(evt);
}
});

jtxtlaonamount.setBackground(new java.awt.Color(255, 255, 255));
jtxtlaonamount.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jtxtlaonamount.setHorizontalAlignment(javax.swing.JTextField.CENTER);

jtxtmonthlypayment.setEditable(false);
jtxtmonthlypayment.setBackground(new java.awt.Color(232, 232, 232));
jtxtmonthlypayment.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jtxtmonthlypayment.setHorizontalAlignment(javax.swing.JTextField.CENTER);

jtxttotalpayment.setBackground(new java.awt.Color(232, 232, 232));
jtxttotalpayment.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jtxttotalpayment.setHorizontalAlignment(javax.swing.JTextField.CENTER);

jPanel8.setBorder(javax.swing.BorderFactory.createEtchedBorder());

jtxtReceipt.setBackground(new java.awt.Color(255, 255, 255));
jtxtReceipt.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jtxtReceipt.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jtxtReceiptPropertyChange(evt);
}
});

javax.swing.GroupLayout jtxtReceiptLayout = new javax.swing.GroupLayout(jtxtReceipt);
jtxtReceipt.setLayout(jtxtReceiptLayout);
jtxtReceiptLayout.setHorizontalGroup(
jtxtReceiptLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 417, Short.MAX_VALUE)
);
jtxtReceiptLayout.setVerticalGroup(
jtxtReceiptLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 260, Short.MAX_VALUE)
);

javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jtxtReceipt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jtxtReceipt, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);

jLoanCal.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jLoanCal.setText("Loan");
jLoanCal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jLoanCalActionPerformed(evt);
}
});

jReset.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jReset.setText("Reset");
jReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jResetActionPerformed(evt);
}
});

jReceipt.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jReceipt.setText("Receipt");
jReceipt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jReceiptActionPerformed(evt);
}
});

jExit.setFont(new java.awt.Font("Cantarell", 1, 22)); // NOI18N
jExit.setText("Exit");
jExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jExitActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGap(46, 46, 46)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5))
.addGap(27, 27, 27)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jtxtEnter, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jtxtnumberofyears, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addComponent(jtxtlaonamount, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jtxttotalpayment, javax.swing.GroupLayout.Alignment.TRAILING))
.addComponent(jtxtmonthlypayment, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addComponent(jLoanCal, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jReset, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jReceipt, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jExit, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(36, Short.MAX_VALUE))
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
.addGap(35, 35, 35)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jtxtEnter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jtxtnumberofyears, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jtxtlaonamount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jtxtmonthlypayment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jtxttotalpayment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(43, 43, 43)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLoanCal)
.addComponent(jReset)
.addComponent(jExit)
.addComponent(jReceipt))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(43, 43, 43)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(11, 11, 11)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(15, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(56, 56, 56)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(244, Short.MAX_VALUE))
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);

pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents

private void jbtn1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn1ActionPerformed
String Enternumber = jlblDisplay.getText() + "1";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn1ActionPerformed

private void jbtn2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn2ActionPerformed
String Enternumber = jlblDisplay.getText() + "2";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn2ActionPerformed

private void jbtn4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn4ActionPerformed
String Enternumber = jlblDisplay.getText() + "4";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn4ActionPerformed

private void jbtn5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn5ActionPerformed
String Enternumber = jlblDisplay.getText() + "5";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn5ActionPerformed

private void jbtn7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn7ActionPerformed
String Enternumber = jlblDisplay.getText() + "7";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn7ActionPerformed

private void jbtn8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn8ActionPerformed
String Enternumber = jlblDisplay.getText() + "8";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn8ActionPerformed

private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jButton13ActionPerformed

private void jbtnZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnZeroActionPerformed
String Enternumber = jlblDisplay.getText() + "0";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtnZeroActionPerformed

private void jtxtEnterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxtEnterActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jtxtEnterActionPerformed

private void jbtn6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn6ActionPerformed
String Enternumber = jlblDisplay.getText() + "6";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn6ActionPerformed
private JFrame frame;
private void jExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jExitActionPerformed
// Exit button:
frame = new JFrame("Exit");
if (JOptionPane.showConfirmDialog(frame, "Confirm if you want to exit",
"Loan Management Systems",
JOptionPane.YES_NO_OPTION)== JOptionPane.YES_NO_OPTION){
System.exit(0);
}
}//GEN-LAST:event_jExitActionPerformed

private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
jLoanCal.setEnabled(false);
jReset.setEnabled(false);
jReceipt.setEnabled(false);
jExit.setEnabled(false);

jbtnBalance.setEnabled(false);
jbtnWithdraw.setEnabled(false);
jbtnDeposit.setEnabled(false);
jBtnLoan.setEnabled(false);

jlblBalance.setEnabled(false);
jlblWithdraw.setEnabled(false);
jlblDeposit.setEnabled(false);
jlblLoan.setEnabled(false);

jtxtDisplay.append(
"Balance \n\t Loan " +
"\n\n\nWithdrawal \n\t Deposit");
jtxtDisplay.setVisible(false);
}//GEN-LAST:event_formWindowActivated

private void jBtnLoanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnLoanActionPerformed
jLoanCal.setEnabled(true);
jReset.setEnabled(true);
jReceipt.setEnabled(true);
jExit.setEnabled(true);
}//GEN-LAST:event_jBtnLoanActionPerformed

private void jReceiptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jReceiptActionPerformed
String annualInterestRate = String.format(jtxtmonthlypayment.getText());
String numberOfYears = String.format(jtxtnumberofyears.getText());
String loanAmount = String.format(jtxtlaonamount.getText());

String monthlyPayment = String.format(jtxtmonthlypayment.getText());
String totalPayment = String.format(jtxttotalpayment.getText());
//==================================================================
int refs = 1325 + (int) (Math.random()*4238);
//==================================================================
Calendar timer = Calendar.getInstance();
timer.getTime();
SimpleDateFormat tTime = new SimpleDateFormat("HH:mm:ss");
tTime.format(timer.getTime());
SimpleDateFormat Tdate = new SimpleDateFormat("dd-MMM-yyyy");
Tdate.format(timer.getTime());

//==================================================================
jtxtReceipt.append("\tLoan Management Systems\n" +
"Reference:\t\t\t" + refs +
"\n=======================================\t" +
"\nInterest rate:\t\t\t " + annualInterestRate +
"\nRepayment years:\t\t\t " + numberOfYears +
"\nAmount of Loan:\t\t\t " + "Xaf" + loanAmount +
"\nMonthly payment: \t\t " + monthlyPayment +
"\nTotal payment:\t\t\t " + totalPayment +

"\n========================================\t" +
"\nDate: " + Tdate.format(timer.getTime()) +
"\t\tTime: " + tTime.format(timer.getTime()) +
"\n\n\t\tThank you\n" );
}//GEN-LAST:event_jReceiptActionPerformed

private void jResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jResetActionPerformed
jtxtEnter.setText(null);
jtxtnumberofyears.setText(null);
jtxtlaonamount.setText(null);
jtxttotalpayment.setText(null);
jtxtmonthlypayment.setText(null);
jtxtReceipt.setText(null);
}//GEN-LAST:event_jResetActionPerformed

private void jLoanCalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jLoanCalActionPerformed
double annualInterestRate = Double.parseDouble(jtxtEnter.getText());
double monthlyInterestRate = annualInterestRate / 1200;
int numberOfYears = Integer.parseInt(jtxtnumberofyears.getText());
double loanAmount = Double.parseDouble(jtxtlaonamount.getText());
//=====================================================================
double monthlyPayment = loanAmount * monthlyInterestRate / (1 - 1 /Math.pow(1 +
monthlyInterestRate,
numberOfYears * 12 ));
String imonthlyPayment;
imonthlyPayment = Double.toString(monthlyPayment);
imonthlyPayment = String.format("Xaf%.2f", monthlyPayment);
jtxtmonthlypayment.setText(imonthlyPayment);
//=====================================================================
double totalPayment = monthlyPayment * numberOfYears * 12;
String itotalPayment;
itotalPayment = String.format("Xaf%.2f", totalPayment);
jtxttotalpayment.setText(itotalPayment);
}//GEN-LAST:event_jLoanCalActionPerformed

private void jtxtReceiptPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jtxtReceiptPropertyChange
// TODO add your handling code here:
}//GEN-LAST:event_jtxtReceiptPropertyChange

private void jbtn3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn3ActionPerformed
String Enternumber = jlblDisplay.getText() + "3";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn3ActionPerformed

private void jbtn9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn9ActionPerformed
String Enternumber = jlblDisplay.getText() + "9";
jlblDisplay.setText(Enternumber);
}//GEN-LAST:event_jbtn9ActionPerformed

private void jbtnClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnClearActionPerformed

jlblDisplay.setText("");
jLoanCal.setEnabled(false);
jReset.setEnabled(false);
jReceipt.setEnabled(false);
jExit.setEnabled(false);
jbtnBalance.setEnabled(false);
jbtnWithdraw.setEnabled(false);
jbtnDeposit.setEnabled(false);
jBtnLoan.setEnabled(false);
}//GEN-LAST:event_jbtnClearActionPerformed

private void jlblDisplayPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jlblDisplayPropertyChange
// TODO add your handling code here:
}//GEN-LAST:event_jlblDisplayPropertyChange

private void jbtnEnterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnEnterActionPerformed
int pin1 = Integer.parseInt(jlblDisplay.getText());
if(pin1 == 4713){
jbtnBalance.setEnabled(true);
jbtnWithdraw.setEnabled(true);
jbtnDeposit.setEnabled(true);
jBtnLoan.setEnabled(true);
jlblBalance.setEnabled(true);
jlblWithdraw.setEnabled(true);
jlblDeposit.setEnabled(true);
jlblLoan.setEnabled(true);
}else{
jlblDisplay.setText("INVALID CODE");
}

}//GEN-LAST:event_jbtnEnterActionPerformed

private void jtxtnumberofyearsKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtxtnumberofyearsKeyTyped
char iNumber = evt.getKeyChar();
if(!(Character.isDigit(iNumber))
|| (iNumber == KeyEvent.VK_BACK_SPACE)
|| (iNumber == KeyEvent.VK_DELETE)){
evt.consume();
}
}//GEN-LAST:event_jtxtnumberofyearsKeyTyped

private void jbtnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCancelActionPerformed
frame = new JFrame("Exit");
if (JOptionPane.showConfirmDialog(frame, "Confirm if you want to exit",
"ATM Systems",
JOptionPane.YES_NO_OPTION)== JOptionPane.YES_NO_OPTION){
System.exit(0);
}
}//GEN-LAST:event_jbtnCancelActionPerformed

/**
  • @param args the command line arguments
  • /

public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(ATMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(ATMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(ATMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(ATMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ATMS().setVisible(true);
}
});
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnLoan;
private javax.swing.JButton jButton13;
private javax.swing.JButton jButton15;
private javax.swing.JButton jButton16;
private javax.swing.JButton jExit;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JButton jLoanCal;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JButton jReceipt;
private javax.swing.JButton jReset;
private javax.swing.JButton jbtn1;
private javax.swing.JButton jbtn2;
private javax.swing.JButton jbtn3;
private javax.swing.JButton jbtn4;
private javax.swing.JButton jbtn5;
private javax.swing.JButton jbtn6;
private javax.swing.JButton jbtn7;
private javax.swing.JButton jbtn8;
private javax.swing.JButton jbtn9;
private javax.swing.JButton jbtnBalance;
private javax.swing.JButton jbtnCancel;
private javax.swing.JButton jbtnClear;
private javax.swing.JButton jbtnDeposit;
private javax.swing.JButton jbtnEnter;
private javax.swing.JButton jbtnWithdraw;
private javax.swing.JButton jbtnZero;
private javax.swing.JLabel jlblBalance;
private javax.swing.JLabel jlblDeposit;
private javax.swing.JLabel jlblDisplay;
private javax.swing.JLabel jlblLoan;
private javax.swing.JLabel jlblWithdraw;
private javax.swing.JPanel jtxtDisplay;
private javax.swing.JPanel jtxtDisplay1;
private javax.swing.JTextField jtxtEnter;
private javax.swing.JPanel jtxtReceipt;
private javax.swing.JTextField jtxtlaonamount;
private javax.swing.JTextField jtxtmonthlypayment;
private javax.swing.JTextField jtxtnumberofyears;
private javax.swing.JTextField jtxttotalpayment;
// End of variables declaration//GEN-END:variables
}

1 réponse

Whismeril Messages postés 19029 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 26 avril 2024 656
2 mars 2018 à 16:39
Bonjour

Merci de garder à l'esprit que CodeS-SourceS et CCM sont des communautés d'entraide. Toutes les réponses sur le forum sont assurées par des bénévoles qui donnent de leur temps libre pour aider à résoudre les problèmes.

A noter également que nous ne faisons pas dans le "tout cuit". Soit tu trouves ton bonheur dans la partie sources du site, soit à l'aide de ton moteur de recherche favori. Ici, nous aidons volontiers sur une difficulté technique, précise et parfaitement isolée rencontrée dans le cours du développement.

Penser à poster le morceau de code qui pose problème, voir ici comment utiliser la coloration syntaxique. S'il y a un message d'erreur retranscrivez le dans son intégralité, en précisant à quelle ligne apparait cette erreur.

des conseils d'écriture des messages et ici et en particulier pour les devoirs scolaires ou PFE.

Penser que le titre doit refléter le contenu de la demande, "Question", "Problème" ou "Java", ne sont ni accrocheurs, ni utiles. Il semble évident qu'une question posée sur un forum de programmation Java tournera autour d'un problème lié à ce langage.

Et enfin, le plus important
.

Merci donc de reformuler ta demande en respectant ces quelques points.


0
Rejoignez-nous