• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

IE6 applet problem html posted

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi:
please check out:
Applets;
Problem with Milonic Script and Frame Implementation;
Troubleshooting
 
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic