mark beak

Greenhorn
+ Follow
since May 27, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mark beak

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 ]
20 years ago
explorer browser can't find class to open. however netscape opens applet ok. I placed class file in same directory.what could be the problem?
<!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 03, 2003: Message edited by: mark beak ]
[ June 05, 2003: Message edited by: mark beak ]
20 years ago
i have a java file that was compiled to a class. The class file in an applet used in a html page. the applet opens in netscape 6 not in explorer 6. i only get the empty outline box where the applet should be in the web page. i checked advance settings java in enabled security looks ok. i'm over looking something simple any suggetions. thaks.beaker_37@hotmail.com