21 Question Related To Applet
21 Question Related To Applet
1. What is Applet?
Ans:
It is a special type of program that is embedded in the webpage to generate the
dynamic content
Ans:
To control applet program java provide 5 predefined method which is known as
life cycle of applet. They are
i) Init()
ii) Start()
iii) Paint()
iv) Stop()
v) Destroy ().
Ans:
Applet program can execute by web browser.
Ans:
java.awt.Panel is the super class of Applet class.
Ans:
It is used to initialized the applet which invoked only once .In this method some
block of statement perform one time operation.
Ans:
Using the getImage() Methods
7. How does applet recognize the height and width?
Ans:
<APPLET> is a predefined tag present in HTML. This tag having two attributes
I.e. height and width which recognize the height and width of applet.
Ans:
FlowLayout is the default layout of Applet.
9. How Applet program can run?
Ans:
There are two ways to run an applet. They are
i) by html file
ii) by applet viewer tool.
Ans:
Applet package contain only one class.
Ans:
A standalone application is one which runs in the context of local disk and whose
result is not shareable. Every standalone application runs from command prompt
and it contains many method along with System.Out.Println statement.
Ans:
A distributed application is one which runs in the context of browser or world
wide web & it can be accussed across the globe.it does not contain main method
and System.out.println statement.
Ans:
i) Init()
ii) Destroy()
Ans:
The Paint() method comes under awt.
15. State which class provide how many life cycle method?
Ans:
java.applet.Applet class provide s 4 life cycle method and java. awt . component
class provide 1 life cycle method.
Ans:
java plug-in software is responsible to manage the lifecycle of an applet.
Ans:
java.awt.Graphics class provide drawImage() method to display the image.
Ans:
The component class implements upon Image observer interface.
Ans:
JApplet class extends the applet class.
Ans:
Painting operation in applet done by mouseDragged() method of
MouseMotionListener.
Ans:
java.applet.AppletContext class provides the facility for communication between
applets.
Ans:
getApplet() method returns the object of applet.
Ans: