how to create an applet

Answer Posted / akansha

Here is the java code of program :

import java.applet.*;
import java.awt.*;

public class FirstApplet extends Applet{
public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}


Here is the HTML code of the program:

<HTML>
<HEAD>
</HEAD>
<BODY>
<APPLET ALIGN="CENTER" CODE="FirstApplet.class" WIDTH="800"
HEIGHT="500"></APPLET>
</BODY>
</HTML>

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is bubble sorting in java?

684


Is passing by reference faster?

612


What are the difference between string, string builder, and string buffer in java?

633


What is incompatible types in java?

628


What is an object's lock and which object's have locks in java programming?

643






Variable of the boolean type is automatically initialized as?

688


Is vector synchronized in java?

645


Is there is any difference between a scrollbar and a scrollpane?

640


Can a hashset contain duplicates java?

587


Can we convert list to set in java?

606


What does a void function return?

647


How can we use primitive data types as objects?

639


Does string is thread-safe in java?

677


What is a jagged array in java?

647


What is a class component?

720