Error with Java Applet
I have this Java code -
(Which is compiled into HelloWorld.class)
public class HelloWorld extends Applet
public void init()
// This method gets called when the applet is terminated
// That's when the user goes to another page or exits the browser.
public void stop()
// The standard method that you have to use to paint things on screen
// This overrides the empty Applet method, you can't called it "display" for example.
public void paint(Graphics g)
//method to draw text on screen
// String first, then x and y coordinate.
g.drawString("Hey hey hey",20,20);
and this html
However, when I load the html page, the java applet just says
<title>My First Java Applet</title>
Here's my first Java Applet:<br /><br />
<applet code="HelloWorld.class" width="300" height ="300">
Error. Click for details
When I click, it freezes the webpage (and the browser).
Any suggestions on what to do?
I figured it out; I hadn't enabled the java plugin when I reinstalled java...