Hi I am in need of some help for modifying my mortgage calculator program for my java class.
I am getting many errors as I dont know how to fix it. Can anyone point me in the right direction?
Thanks in advance.
Code:
//pos407
//9-16-2005
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JOptionPane; // import class JOptionPane
import java.text.DecimalFormat; // import class DecimalFormat
public class W2_tran extends JFrame implements ActionListener
{
static DecimalFormat decmat = new DecimalFormat("$#,##0.00");
FlowLayout flow = new FlowLayout();
JLabel amount1 = new JLabel("Amount: ");
JTextField amount = new JTextField(10);
JLabel rate1 = new JLabel("Rate: ");
JTextField rate = new JTextField(4);
JLabel term1 = new JLabel("Term: ");
JTextField term = new JTextField(4);
JComboBox mortgageBox = new JComboBox();
JLabel mortgageList = new JLabel("<html><font face='Tahoma' size='5'>Mortgage</font></html>");
JButton calcButton = new JButton("Calculate Total");
JButton exitButton = new JButton("Exit");
JButton reset = new JButton("Reset");
JLabel blankSpaces1 = new JLabel(" ");
JLabel blankSpaces2 = new JLabel(" ");
JLabel result = new JLabel("<html><h1>The total is </h1></html>");
JLabel sum = new JLabel("");
public W2_tran()
{
Container con = getContentPane();
con.setLayout(flow);// places components in a row
con.add(amount1);
con.add(amount);
con.add(rate1);
con.add(rate);
con.add(term1);
con.add(term);
con.add(calcButton);
con.add(blankSpaces1);
con.add(result);
con.add(sum);
mortgageBox.addItem("Mortage Inputs Above");
mortgageBox.addItem(" 7-year Mortgage at 5.35%");
mortgageBox.addItem("15-year Mortgage at 5.5%");
mortgageBox.addItem("30-year Mortgage at 5.75%");
con.add(blankSpaces2);
con.add(exitButton);
con.add(reset);
con.add(mortgageList);
con.add(mortgageBox);
// formats numbers to display only two decimal places
// different decimal formats ensure $ sign & "0.00" print wherever needed
java.text.DecimalFormat dec = new java.text.DecimalFormat(",##0.00");
java.text.DecimalFormat doldec = new java.text.DecimalFormat("$,##0.00");
// formats numbers to display only two decimal places
// different decimal formats ensure $ sign & "0.00" print wherever needed
java.text.DecimalFormat dec = new java.text.DecimalFormat(",##0.00");
java.text.DecimalFormat doldec = new java.text.DecimalFormat("$,##0.00");
// formats numbers to display only two decimal places
// different decimal formats ensure $ sign & "0.00" print wherever needed
java.text.DecimalFormat dec = new java.text.DecimalFormat(",##0.00");
java.text.DecimalFormat doldec = new java.text.DecimalFormat("$,##0.00");
// formats numbers to display only two decimal places
// different decimal formats ensure $ sign & "0.00" print wherever needed
java.text.DecimalFormat dec = new java.text.DecimalFormat(",##0.00");
java.text.DecimalFormat doldec = new java.text.DecimalFormat("$,##0.00");