0% found this document useful (0 votes)
59 views

Experiment 08: Aim: Write A Program in Java To Implement Applet

The document describes an experiment to create a simple Java applet. The program imports Applet and Graphics classes and defines a HelloWorld class that extends Applet. It overrides the paint method to draw the string "Hello! This is an applet." at coordinates 20,20. The HTML file embeds the applet with a width and height specified. When run, the output displays the drawn string within the applet frame.

Uploaded by

vishal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Experiment 08: Aim: Write A Program in Java To Implement Applet

The document describes an experiment to create a simple Java applet. The program imports Applet and Graphics classes and defines a HelloWorld class that extends Applet. It overrides the paint method to draw the string "Hello! This is an applet." at coordinates 20,20. The HTML file embeds the applet with a width and height specified. When run, the output displays the drawn string within the applet frame.

Uploaded by

vishal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EXPERIMENT 08

Aim: Write a program in Java to implement applet.

JAVA FILE:
import java.applet.Applet;

import java.awt.Graphics;

// HelloWorld class extends Applet

public class HelloWorld extends Applet

// Overriding paint() method

@Override

public void paint(Graphics g)

g.drawString("Hello! This is an applet.", 20, 20);

HTML FILE:

<applet code="HelloWorld" width=500 height=100>

</applet>
OUTPUT :

You might also like