Mortgagecalc.Java

We have many free term papers and essays on Mortgagecalc.Java. We also have a wide variety of research papers and book reports available to you for free. You can browse our collection of term papers or use our search engine.

Mortgagecalc.Java

//Import statements
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import javax.swing.JOptionPane;

//class header
//Frame=top-level container | the MortgageCalc class will be a subclass of "Frame"
//ActionListener tells program to listen for/respond to user event

public class MortgageCalc extends Frame implements ActionListener
{

//declare variables
private Button calculateBTN;
private Button quitBTN;
private TextField amountTXF;
private TextField termTXF;
private TextField rateTXF;
private DecimalFormat calcPattern;
private boolean hitCalculate;
private Panel calcPNL;
private Panel textFieldsPNL;
private Label amountLBL;
private Label rateLBL;
private Label termLBL;

//constructor method header
public MortgageCalc()
{
//creates menu bar
MenuBar mnuBar = new MenuBar();
setMenuBar(mnuBar);

//adds "File" to menu bar
Menu mnuFile = new Menu("File", true);
mnuBar.add(mnuFile);
MenuItem mnuFileExit = new MenuItem("Exit");
mnuFile.add(mnuFileExit);

//adds "About" to menu bar
Menu mnuAbout = new Menu("About", true);
mnuBar.add(mnuAbout);
MenuItem mnuAboutMortgageCalculator = new MenuItem("About Mortgage Calculator");
mnuAbout.add(mnuAboutMortgageCalculator);

//add ActionListener to menu items
mnuFileExit.addActionListener(this);
mnuAboutMortgageCalculator.addActionListener(this);

//sets ActionCommand to menu items
mnuFileExit.setActionCommand("Exit");
mnuAboutMortgageCalculator.setActionCommand("About");

//initialize variables...
...
  • Submitted by: robinmatthews
  • Date Submitted: 06/04/2006 06:38 PM
  • Category: Technology
  • Words: 604
  • Pages: 3
  • Views: 323
  • Rank: 87001

Related Essays

  • Mortgagecalc.Java MortgageCalc.java. //Import statements import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.text.DecimalFormat ......
  • Java Calculator Java Calculator. /* Mortgage Calculator Date: April 16, 2008 Filename: MortgageCalc.java Purpose: This is a program to calculate the mortgage us...
  • Mortgage Calculator Jave Mortgage Calculator Jave. /* Week 2 individual assignment by William Velez Version 1.1 Edited by William Velez on September 27th, 2007 MortgageCalc....

Saved Papers

Save papers so you can find them more easily!

Join Now

Get instant access to over 170,000 papers.

Join Now