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
What is meant by JVM? Is JVM platform independent or not?
Can one thread block the other thread?
What is the difference between access specifiers and access modifiers in java? 16
What is memory leak and how does java handle it?
Why vector is used in java?
What is entry in java?
What are the two ways to create a thread?
When should I use a singleton?
Is it possible to write a regular expression to check if string is a number?
what is the purpose of "virtual"?
what are the methods in object?
Why is the type for real numbers called double?
Should a main method be compulsorily declared in all java classes?
What is the use of pattern in java?
Can a hashset contain duplicates java?