Gui Mortgage Calculator
Below is one of our free research papers on Gui Mortgage Calculator. If the term paper below is not exactly what you're looking for, you can search our essay database for other topics or order a custom essay.
Gui Mortgage Calculator
GUI Mortgage Calculator
University of Phoenix
David Silberberg
POS 407
04-19-2005
Program
/*
* MortgageGui.java
* Version 4
* Created on April 19, 2005
* Use a graphical interface to allow a user to input a principle amount, interest rate
* and term of loan then calculate loan payment.
* Added text field to show amortization of loan. Also checked for last payment equal to
* less than monthly payment. Added in the ability to select a predefined interest rate
* and term. Added in the ability to read in from a file (file is found in C:\mortgagein.txt).
*
*
* @author ************
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.NumberFormat;
import java.text.DecimalFormat;
import java.io.*;
public class MortgageGUI extends JFrame implements ActionListener {
double total = 0; //monthly payment initalization of variables
double i = 0; //interest
double p = 0; //principle
int t = 0; //term in years
int m = 0; //monthly term
double j = 0; //daily interest rate
double mPayment = 0;
double monthlyInterest = 0;
double principleOnly = 0;
double newBalance = 0;
int choice = 0;
//setup row
JPanel row = new JPanel();
JLabel heading = new JLabel("Mortgage Calculator", JLabel.CENTER);
//setup row 1
JPanel row1 = new JPanel();
JLabel principle = new JLabel("Amount to Borrow:", JLabel.RIGHT);
JTextField princ = new JTextField("100000", 6);
JLabel term = new JLabel(" Years:", JLabel.RIGHT);
JTextField years = new JTextField("", 3);
JLabel rate = new JLabel(" Interest Rate:", JLabel.RIGHT);
JTextField irate = new JTextField("", 4);
//setup row 2
JPanel row2 = new JPanel();
JLabel termInt = new JLabel("Select the Term and interest rate:", JLabel.LEFT);
String[] formats = {"Choose from below or enter your own","7 years @ 5.35%", "15 years @ 5.5%", "30 years @ 5.75%","Enter a file in line below"};
JComboBox combo...
- Submitted by: sstan03
- Date Submitted: 09/18/2005 01:12 PM
- Category: Technology
- Words: 1963
- Pages: 8
- Views: 3106
- Rank: 11940