Step in creating an Applet

An applet is a program that runs in the web browser

 

1. The java.applet package must be included.

 

2. The class must extend from the Applet class.

 

3. Writing and compiling the Java code.

 

4. Writing a HTML code that will run the applet.

 

A Simple Applet

 

import java.applet.*;        
public class MyApplet extends Applet{}    

HTML Code

 

<html>

<body>
	<title>Applet Test Page</title>    
	<h1>Applet Test Page</h1>    
	<applet code="MyApplet.class" width=250 height=250 name="MyApplet">
   </applet>  

</body>
</html>

 


 

 

 
Make a Free Website with Yola.