Hey guys, I've created a java applet which calculates PPI. my problem occurs when I add it to a webpage on dreamweaver. I get the following error message:
load: class calculator.java not found.
java.lang.ClassNotFoundException: calculator.java
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: H:\nnoooo\PPI website\calculator\java.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: calculator.java
This is the HTML code:
<applet code="calculator.java" width="250" height="250">
</applet>
Heres my java applet code:
import java.util.Scanner;
import java.applet.*;
public class calculator extends Applet{
Scanner nuggz = new Scanner(System.in);
Double payment,length,answer;
int months = 12;
{
System.out.println("Enter your montly payment: ");
payment=nuggz.nextDouble();
System.out.println("Enter the length of the loan: ");
length=nuggz.nextDouble();
answer= (payment/100*20)*months*length;
System.out.println("Your estimated claim is: " +answer);
}
}
Any help would be greatly appreciated.
Cheers.