Mortgage Calculator (gui)
Essay by people • September 21, 2011 • Study Guide • 889 Words (4 Pages) • 1,451 Views
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
*
*Change Request #4
Requestor: Ninfa Pendleton - Rapid City, SD
Program: Mortgage Calculator # 4 Week 2 (GUI)
*
*/
public class Mortgage4 extends JFrame {
/****
* Following will define the controls that we will going to use in the programm
*
*
*
*/
private JLabel labelLoanAmount;
private JLabel labelInterest;
private JLabel labelTerm;
private JTextField textLoanAmount;
private JTextField textInterest;
private JTextField textTerm;
private JLabel labelPMT;
private JLabel labelPMT1;
private JButton btnClaculate;
private JButton btnExit;
private JPanel Contpane;
private JPanel Btnpane;
/*
* Constructor
* Will Initialize All Controls And The It Will Show The GUI Window
*/
public Mortgage4() {
super("Mortgage Calculator");
Contpane = new JPanel(new GridLayout(4, 3, 10, 10));
Btnpane = new JPanel(new GridLayout(1, 2, 5, 5));
labelInterest = new JLabel("Interest rate %");
labelLoanAmount = new JLabel("Loan Amount $");
labelTerm = new JLabel("Terms In Years");
labelPMT = new JLabel("Monthly Payment Is $ ");
labelPMT1 = new JLabel("0.00");
textInterest = new JTextField();
textLoanAmount = new JTextField();
textTerm = new JTextField();
//Action Listner For Calculate Button
Action calculateAction = new AbstractAction("Calculate") {
...
...