[go: up one dir, main page]

0% found this document useful (0 votes)
13 views3 pages

Javaapplet

The document provides instructions for creating and running a simple Java applet named HelloApplet. It includes the Java code for the applet, the corresponding HTML file to display it, and steps for compiling and running the applet. The output of the applet displays the text 'hello I am leo' on the screen.

Uploaded by

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

Javaapplet

The document provides instructions for creating and running a simple Java applet named HelloApplet. It includes the Java code for the applet, the corresponding HTML file to display it, and steps for compiling and running the applet. The output of the applet displays the text 'hello I am leo' on the screen.

Uploaded by

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

Java applet

Step1:
(HelloApplet.java) file name

Code:

import java.awt.*;

import java.applet.*;

public class HelloApplet extends Applet

public void paint(Graphics g)

g.drawString("hello i am leo ",65,35);

Setp2:
compile the java file and then we get the class file

(HelloApplet.html) you save it any file name

Code:

<html>

<head>

<body>

<applet code="HelloApplet.class" width="400" height="200"> //put the correct class file


name

</applet>

</body>

</head>

</html>
Java applet
File directory structure:

Once you compile the HelloApplet.java file we get the class file

Setp3:
1) Don’t set the path directly compile the file.

HelloApplet.class file is created in the directory.


Java applet
Step4:
1) Run the html file

Step5:
Output:

You might also like