Docsity

Creating a Java Applet: A Step-by-Step Guide, Exercises of Java Programming

Toggle sidebar
bg1
Do not use the JBuilder Applet Wizard at this step
1. Following the following steps to create your first applet
a. Import the following packages into your program
import java.applet.*;
import java.awt.*;
b. Create a class of your choice
c. Extend the class from java.applet.Applet class
d. Add the following method
public void paint(Graphics g)
e. Add g.drawString(“Hello World”,25,25)
f. Save the program to a file HelloWorld.java
g. Compile the file
h. Create the following html file
<html>
<applet codebase=“.” code=“HelloWorld.class” height=100
width=100 >
</applet>
</html>
i. Save this file to the location where your class file resides
2. Try JBuilder to create a similar applet
3.
Day-03
Exercise-01
Java-Programming
Docsity.com

Partial preview of the text

Download Creating a Java Applet: A Step-by-Step Guide and more Exercises Java Programming in PDF only on Docsity!

Do not use the JBuilder Applet Wizard at this step

  1. Following the following steps to create your first applet a. Import the following packages into your program import java.applet.; import java.awt.; b. Create a class of your choice c. Extend the class from java.applet.Applet class d. Add the following method public void paint(Graphics g) e. Add g.drawString(“Hello World”,25,25) f. Save the program to a file HelloWorld.java g. Compile the file h. Create the following html file <applet codebase=“.” code=“HelloWorld.class” height= width=100 > i. Save this file to the location where your class file resides
  2. Try JBuilder to create a similar applet

Day- 03

Exercise- 01 Java-Programming

Docsity.com