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

A step-by-step guide on how to create a java applet using the jdk and jbuilder. It covers importing packages, creating a class, extending applet, adding the paint method, and saving the html file.

Typology: Exercises

2011/2012

Uploaded on 07/07/2012

virat
virat 🇮🇳

5 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Do not use the JBuilder Applet Wizard at this ste p
1. Following the following steps t o create your first applet
a. Import the following pac kages into your program
import java.applet.* ;
import java.awt.*;
b. Create a c lass of your c hoice
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 t he program to a file HelloWorld.java
g. Compile the file
h. Create the following html file
<html>
<applet c odebase=“.” code=“HelloWorld.c lass” height=100
width=100 >
</applet>
</html>
i. Save t his file to the locat ion 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
i. Save this file to the location where your class file resides 
  1. Try JBuilder to create a similar applet

Day- 03

Exercise- 01 Java-Programming

docsity.com