Pos 407 Week1

Below is one of our free research papers on Pos 407 Week1. 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.

Pos 407 Week1

/**
This is the Week2 Mortgage calculator GUI box for POS 407, calculates loan, rate, and term.
*/

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Week2 implements ActionListener {

JFrame calculatorFrame;
JPanel calculatorPanel;

JTextField loan;
JTextField rate;
JTextField term;

JLabel loanLabel,termLabel, rateLabel, pmtLabel;

JButton calculate;

public Week2() {

if(readData()) {

calculatorFrame = new JFrame("Week 2 Mortgage Calculator");
calculatorFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

calculatorFrame.setBounds(0,0,100,100);

calculatorPanel = new JPanel(new GridLayout(10, 10));

addWidgets();

calculatorFrame.getRootPane().setDefaultButton(calculate);

calculatorFrame.getContentPane().add(calculatorPanel, BorderLayout.
CENTER);

calculatorFrame.pack();
calculatorFrame.setVisible(true);
}
}

private boolean readData() {

boolean isValid = true;
// we don't do anything, we will use this later
return isValid;
}

private void addWidgets() {

loan = new JTextField();
rate = new JTextField();
term = new JTextField();
loanLabel = new JLabel("Loan", SwingConstants.LEFT);
termLabel = new JLabel("Term", SwingConstants.LEFT);
rateLabel = new JLabel("Interest", SwingConstants.LEFT);
calculate = new JButton("Calculate");
pmtLabel = new JLabel("Monthly Payment", SwingConstants.LEFT);

calculate.addActionListener(this);

calculatorPanel.add(loan);
calculatorPanel.add(loanLabel);
calculatorPanel.add(term);
calculatorPanel.add(termLabel);
calculatorPanel.add(rate);
calculatorPanel.add(rateLabel);
calculatorPanel.add(calculate);
calculatorPanel.add(pmtLabel);...
  • Submitted by: bubadutep75
  • Date Submitted: 10/22/2007 06:38 PM
  • Category: Technology
  • Words: 765
  • Pages: 4
  • Views: 533
  • Rank: 57943

Saved Papers

Save papers so you can find them more easily!

Join Now

Get instant access to over 180,000 papers.

Join Now