Re: how to create applets?
1. For creating applet, you need to install JDK and JRE. Make folder named "jdk" under C drive.
2. Type the following source code on a Notepad:
import java.awt.*;
import java.applet.Applet;
public class MyFirstApplet extends Applet {
public void paint (Graphics g) {
g.drawString("This is my first Applet!!!", 100, 25);
}
}
Save the file as "C:\MyFirstApplet.java."
3. Compile the Java source code. Click Start > Run > Type: "javac C:\MyFirstApplet.java". This will create file, 'MyFirstApplet.class'. It is your Java applet.
4. Now import it in your HTML.
<APPLET CODE = 'MyFirstApplet.class' WIDTH = 100 HEIGHT = 25 "> ... </APPLET"> in BODY section.
|