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 incompatible types in java?

529


What are green threads in java?

548


What is the difference between final, finally and finalize() in java?

508


What is object data type?

556


Explain the private field modifier?

602






What is stringwriter?

532


Which methods are used during serialization and deserialization process?

542


What is the maximum size of array in java?

506


Explain about serializable interface in java?

570


What are 3 data types?

536


Explain the use of javap tool.

622


What is a type parameter in java?

523


What is scope & storage allocation of global and extern variables? Explain with an example

573


What does flag mean in java?

530


Can a abstract class be declared final?

553