To test it from browser, create an html file, let's say applet.htm
<html>
<body>
<applet code="FirstApplet.class" width=200 height=100> </applet>
</body>
</html>
Make sure this applet.htm saved in the folder where FirstApplet.class
is located.
For your next lesson, try this one to display the hello world... 8)
File: Hello.java
public class Hello extends java.applet.Applet {
public void paint(java.awt.Graphics g) {
g.drawString("Hello World!",50,50);
}
}
Html file: hworld.htm
<html>
<body>
This will display the Hello World from java applet <br>
<applet code="Hello.class" width 200 height = 100> </applet>
</body>
</html>