embedding javascript in html
So, I am just randomly trying to figure out how this works, and failing
I just want to embed a java applet into a plain html page, but I get a error message
What am I doing wrong?
(Yes, I got the .class file in the same folder as the html file)
<html> <body bgcolor=white>
<applet code=MyApplet.class width="200" height="200">
Your browser does not support the <code>applet</code> tag.
</applet>
</body> </html>
========================
import java.applet.*;
import java.awt.*;
public class MyApplet extends Applet {
int width, height;
public void init() {
width = getSize().width;
height = getSize().height;
setBackground( Color.black );
}
public void paint( Graphics g ) {
g.setColor( Color.green );
for ( int i = 0; i < 10; ++i ) {
g.drawLine( width, height, i * width / 10, 0 );
}
}
}
=================================
Java Plug-in 1.6.0_24
Using JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM
----------------------------------------------------
load: class MyApplet.class not found.
java.lang.ClassNotFoundException: MyApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.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)
Exception: java.lang.ClassNotFoundException: MyApplet.class