Pos 407 Week 4
Essay by review • December 31, 2010 • Essay • 394 Words (2 Pages) • 978 Views
import java.awt.*;
import java.awt.event.*;
import java.text.*;
import javax.swing.*;
import javax.swing.table.*;
import java.io.*;
/*
J
Instructions: (Week 2)Write a Java program using a graphical user interface that calculates and
displays the mortgage payment amount from user input of the amount of the mortgage, the term of the
mortgage, and the interest rate of the mortgage. Allow the user to enter new data for new results.
Insert comments in the program to document the program. (Week 3)Modify the mortgage program to
allow the user to input the amount of a mortgage and then select from a menu of mortgage loans:
7 year at 5.35%, 15 year at 5.50%, and 30 year at 5.75%. Use an array for the different loans.
Display the mortgage payment amount. Then, list the loan balance and interest paid for each payment
over the term of the loan. Allow the user to enter a new amount and make a new selection, with
resulting new values.
Allow user to exit if running as an application (can't do that for an applet though).
*/
public class jameswk3 extends JFrame implements ActionListener
{
//Components
JPanel lpanel = new JPanel();
JPanel tpanel = new JPanel();
JPanel p1 = new JPanel();
JPanel pAmount = new JPanel();
JPanel pInterest = new JPanel();
JPanel pTermlngth = new JPanel();
JPanel pPymtresult = new JPanel();
JPanel pButton = new JPanel();
JLabel lAmount = new JLabel();
JLabel lTermlngth = new JLabel();
JLabel lRate = new JLabel();
JLabel lTitle = new JLabel();
JLabel lCombo = new JLabel();
JLabel lPymtresult = new JLabel();
JLabel lMain = new JLabel();
JLabel lMonthlypymt = new JLabel();
JLabel lBalance = new JLabel();
JLabel lInterest = new JLabel();
JButton bCalc = new JButton();
JButton bMonthlypymt = new JButton();
JButton bQuit = new JButton();
JTextField tAmount = new JTextField(8);
JTextField tTermlngth = new JTextField();
JTextField tRate = new JTextField();
JTextField tMonthlypymt = new JTextField(8);
JTextField tPymtresult = new JTextField(8);
JTextField tCombo = new JTextField();
JTextField tBalance = new JTextField();
JTextField tInterest = new JTextField();
String sErrorMessage = "";
boolean bError
...
...