This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes IE6 applet problem html posted Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "IE6 applet problem html posted" Watch "IE6 applet problem html posted" New topic
Author

IE6 applet problem html posted

mark beak
Greenhorn

Joined: May 27, 2003
Posts: 3
the class is in the same directory. IE just draws an empty box. any suggestions. however netscape works ok.i checked settings java for applets enabled security low. code listing is below with html. i'm using java2 1.3.1-04 could be too old ? thanks for any help.
port java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.text.DecimalFormat;
public class MortgageApplet extends Applet implements TextListener {
TextField principalField = new TextField("0.00", 15),
rateField = new TextField("0.00", 6),
yearsField = new TextField("0", 3),
paymentField = new TextField("0.00", 15);
double principal, rate, ratePercent;
int years, n;
final int paymentsPerYear = 12;
final int timesPerYearCalculated = 12;
double effectiveAnnualRate;
double payment;
DecimalFormat currency = new DecimalFormat("####0.00");
public void init()
{
setLayout(new GridLayout(4,2));
Label principalLabel = new Label("Principal $"),
rateLabel = new Label("Rate (%)"),
yearsLabel = new Label("Years"),
paymentLabel = new Label("Payment $");
Panel principalLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
rateLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
yearsLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
paymentLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT));
Panel principalFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
rateFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
yearsFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
paymentFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
principalLabelPanel.add(principalLabel);
principalFieldPanel.add(principalField);
rateLabelPanel.add(rateLabel);
rateFieldPanel.add(rateField);
yearsLabelPanel.add(yearsLabel);
yearsFieldPanel.add(yearsField);
paymentLabelPanel.add(paymentLabel);
paymentFieldPanel.add(paymentField);
add(principalLabelPanel);
add(principalFieldPanel);
add(rateLabelPanel);
add(rateFieldPanel);
add(yearsLabelPanel);
add(yearsFieldPanel);
add(paymentLabelPanel);
add(paymentFieldPanel);
principalField.addTextListener(this);
rateField.addTextListener(this);
yearsField.addTextListener(this);
}

public void textValueChanged (TextEvent e)
{
Object source=e.getSource();
if (source == principalField ||
source == rateField ||
source == yearsField)
{
try
{
principal = Double.valueOf(principalField.getText()).doubleValue();
ratePercent = Double.valueOf(rateField.getText()).doubleValue();
rate = ratePercent/100.0;
years = Integer.parseInt(yearsField.getText());
n = paymentsPerYear * years;
effectiveAnnualRate = rate / paymentsPerYear;
payment = principal*(effectiveAnnualRate / (1 - Math.pow(1 + effectiveAnnualRate, -n)));
paymentField.setText(currency.format(payment));
}
catch (NumberFormatException ex) {}
}
}
}
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Calculate Mortgage Payments</title>
</head>
<body>
<applet code="MortgageApplet"
width=300 height=200></applet>
</body>
</html>
[ June 05, 2003: Message edited by: mark beak ]
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
hi:
please check out:
Applets;
Problem with Milonic Script and Frame Implementation;
Troubleshooting
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: IE6 applet problem html posted
 
Similar Threads
Wrapper
No compilation error in 1 dir, but compilation error in other, why?
GUI
Trapping keys in java applet
Java Applet to Stand alone application