M
Michael Hesse
Hi,
I am following an example from Chapter 1 of a book, and I created an HTML
file and a class file.
The HTML includes this line which pops up a window.
<applet code = "first1.class" width = 300 height = 200>
Then I get this error:
java.lang.ClassFormatError: first1 (Bad magic number)
Here is the contents first1.class (copied carefully from the book.)
==================================================
import javax.swing.JApplet;
import java.awt.Graphics;
public class first1 extends JApplet
{
public void paint(Graphics g)
{
g.drawString("To climb a ladder, start at the bottom run", 20, 90);
}
}
==================================================
Any ideas about what is causing the problem?
Thanks,
Michael
I am following an example from Chapter 1 of a book, and I created an HTML
file and a class file.
The HTML includes this line which pops up a window.
<applet code = "first1.class" width = 300 height = 200>
Then I get this error:
java.lang.ClassFormatError: first1 (Bad magic number)
Here is the contents first1.class (copied carefully from the book.)
==================================================
import javax.swing.JApplet;
import java.awt.Graphics;
public class first1 extends JApplet
{
public void paint(Graphics g)
{
g.drawString("To climb a ladder, start at the bottom run", 20, 90);
}
}
==================================================
Any ideas about what is causing the problem?
Thanks,
Michael