This is a newbie question but I am having trouble running a simple applet on a browser. The applet works via the appletviewer in eclipse so I know it's not that. What is going on is that I have the .class and .html files in the same folder and am trying to view them on a browser via the professor's server.
the .html file
<html>
<head>
<title>Testing Applet</title>
</head>
<body>
<p>This is a test</p>
<applet code="AnAppletSubclass.class" width=150 height=100></applet>
</body>
</html>
java file`
import java.applet.*;
import java.awt.*;
public class AnAppletSubclass extends Applet {
public void init() {
System.err.println("Hello from AnAppletSubClass.init - the current value of n is " + n);
color = Color.cyan;
}
public void paint(Graphics g) {
setBackground(color);
System.err.println("Hello from AnAppletSubClass.paint-- the current value of n is " + n);
n++;
}
Color color;
int n = 0;
}
What happens when viewing the applet is that the "test" text appears but I am getting a ClassNotFoundException and a blank box where the applet should be. I'm unsure why this isn't working since the .class file is compiled fine and in the same folder as the .html. Any help would be appreciated, thanks.