on line 40 I have:
public void start
That is the only thing that is showing something wrong. I have addad, curly brackets with no luck and when I put a semi colon at the end everything after it shows an error. The programs opens the applet but does not initialize it.
Any suggestions??? :icon_question:
import java.awt.*;
import java.awt.event.*;
import javax.swing.AbstractButton;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
@SuppressWarnings("serial")
public class MortgageCalculator2 extends JApplet
implements ActionListener
{
private static final String Total = null;
JLabel MortgageCalculator = new JLabel("Mortgage Calculator");
JLabel principal = new JLabel("Principal");
JLabel interest = new JLabel ("Interest");
JLabel term = new JLabel ("Term");
JButton calcButton = new JButton ("Calculate");
{
{
final Container con = getContentPane();
con.setLayout(new FlowLayout());
final Font bigFont = null;
MortgageCalculator.setFont(bigFont);
con.add(MortgageCalculator);
con.add(calcButton);
calcButton.addActionListener(this);
con.add(principal);
con.add(interest);
con.add(term);
final Component totalResult = null;
con.add(totalResult);
}
{
public void start
{
principal.setText(principal);
interest.setText(interest);
term.setText(payment);
totalResult.setText(Total);
repaint();
}
{
public void actionPerformed;ActionEvent e;
{
Object source = e.getSource();
if (source == calcButton)
{
String Response = JOptionPane.showInputDialog(null,"Enter amount of principal");
String Response = JOptionPane.showInputDialog(null,"Enter amount of interest");
String Response = JOptionPane.showInputDialog(null,"Enter amount of term");
int[] principalLimit = {200000};
int[] interestLimit = {5.35, 5.5, 5.75};
int[] termLimit = {7, 15, 30};
int principal = Integer.parseInt(response);
int principlalFee = 0; int interestFee = 0; int termFee = 0;
int x=0, a=0;
}
for (x = 200000; x>=0; --x)
if (amount >= principal[x])
principal = principal[x];
payment = ((principal * Math.pow(1.0 + workRate, years * 12) * workRate) / (Math.pow(1.0 + workRate, years * 12) -1));
x = 0;
principal.setText("$ + principal + interest");
totalResult.setText(" payment $" + payment);
}
}
}
}
@Override
public void actionPerformed(final ActionEvent arg0) {
// TODO Auto-generated method stub
}
}