/* Title: Java Programming Assignment 3a Programer: Teel Hughes Start Date: 11/22/13 File Name: TeelsApplet1.java Purpose: Programe is to calculate the total property tax paid. */ import java.applet.*; import java.awt.*; import java.awt.event.*; public class TeelsApplet1 extends Applet implements ActionListener { // declare variables int taxpmt1, taxpmt2; int result = taxpmt1 + taxpmt2; //construct components Label companyLabel = new Label("TOTAL PROPERTY TAX "); Label taxpmt1Label = new Label("Enter your tax payment for December. Do not include decimal point or dollar sign.:"); TextField taxpmt1Field = new TextField(10); Label taxpmt2Label = new Label("Enter your tax payment for April. Do not include decimal point or dollar sign.: "); TextField taxpmt2Field = new TextField(10); Button calcButton = new Button("Calculate"); Label outputLabel = new Label("Click the Calculate button to see your total property tax paid."); public void init() { setForeground(Color.blue); add(companyLabel); add(taxpmt1Label); add(taxpmt1Field); add(taxpmt2Label); add(taxpmt2Field); add(calcButton); calcButton.addActionListener(this); add(outputLabel); } public void actionPerformed(ActionEvent e) { taxpmt1 = Integer.parseInt(taxpmt1Field.getText()); taxpmt2 = Integer.parseInt(taxpmt2Field.getText()); outputLabel.setText("YOUR TOTAL TAX PAID IS" + result ); } }