how to create an applet

Answer Posted / krishgopal

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

/*
<applet code="app" width=400 height=500>
</applet>
*/

public class app extends Applet {
public void paint(Graphics g)
{
g.drawString("hi java",100,200);
}
}

here we use applet pack to retrive all its mathods
to create an applet.
and awt to create window events.
all that u known.
paint() is to paint the page that means
create a page and putting everything on it.
"hi java" is a string to dispaly on sgrren and
100,200 are x &y axis' to the text where to
dispaly on screen.

applet code is must to disply an applet prgrm.
width=400 height=500 r size of dispalying screen.

we can dispaly applet prgrm in any browser
with use of HTML prgrm.
for more details just refer "complete reference" book.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a line break example?

657


what type of questions asked for barclays technologies pune please send urgent

5336


Is minecraft 1.15 out?

634


How big is a 64 bit float?

648


List primitive java types?

689






Is java util list serializable?

609


Why string is not a wrapper class?

753


What are mutable classes?

604


What is merge sort in java?

670


Does java allow overriding static methods ?

732


Is there any tag in htm to upload and download files?

695


How do constructors use this() and super()?

650


How java is similar to c?

680


Explain restrictions for using anonymous inner classes?

694


How many types of constructors are used in java?

634