SlideShare a Scribd company logo
1 of 22
RENUGADEVI.S, MSC.,CS
NADAR SARASWATHI COLLEGE
OF ARTS AND SCINCE. THENI.
applet
What is applet?
 An applet is a java program that can be
embedded into a webpage. It runs inside the
web browser and works at client side.
 An applet is embedded in an HTML page
using the applet or object tag and hosted on a
web server.
 Applet are used to make the website more
dynamic and entertaining.
Important points about
Applet
1. All applets are sub-classes(either directly or
indirectly) of java.applet.Applet class.
2. Applet are not stand-alone programs.
Instead, they run within either a web
browser or an applet viewer. JDK provides a
standard applet viewer tool called applet
viewer.
3. In general, execution of an applet does not
begin at main() method.
4. Output of an applet window is not
performed by System.out.println().
5. Rather with various AWT methods, such as
drawString().
Life cycle of an applet
 It is important to understand the order in
which the various methods shown in the
above image are called. When an applet
begins, the following methods are called, in
this sequence:
1.init()
2.start()
3.paint()
 When an applet is terminated, the following
sequence of method calls takes place:
1.stop()
2.destory()
 init()
The init() method is the first method to be
called. Where you should initialize variables.
This method is called only once during the
runtime of applet.
Start(): The start() method is called after
init(). It is also called to restart an applet after
it has been stopped. Note that init() is called
once. i.e.,When the first time an applet is
loaded whereas start() is called each time an
applet’s HTML document is displayed
onscreen. So, if a user leaves a web page and
comes back, the applet resumes execution at
start().
Paint():
The paint() method is called each time an
AWT-based applet’s output must be redrawn.
This situation can occur for several reasons.
For example, the window in which the applet
is running may be overwritten by another
window and then uncovered. ORThe applet
window may be minimized and then
restored.
 Paint() is also called when the applet
begins execution. Whatever the cause,
whenever the applet must redraw its output,
paint() is called.
 paint() method has one parameter of
type Graphics. This parameter will contain
the graphics context, which describes the
graphics environment in which the applet is
running.
Stop():
The stop() method is called when a web
browser leaves the HTML document
containing the applet-when it goes to
another page, example: When stop() is
called, the applet is probably running. Use
stop() to suspend threads that don’t need to
run when the applet is not visible. Restart
them when start() is called if the user returns
to the page.
destroy():
The destroy() method is called when
the environment determines that applet
needs to be removed completely from
memory. At this point , should free up any
resources the applet may be using. The
stop() method is always called before
destroy().
CREATING AN EXECUTABLE
APPLET
 Executable applet is nothing but the .class file
of the applet, which is obtained by compiling
the source code of the applet. Compiling an
applet is exactly the same as compiling an
application. Therefore, we can use the
The Applet class
 Every applet is an extension of the
java.applet.Applet class. The base Applet
class provides methods that a derived Applet
class may call to obtain information and
services from the browser context.
 These include methods that do the following-
 Get applet parameters
 Get the network location of the HTML file
that contains the applet.
 Get the network location of the applet class
directory.
 Print a status message in the browser
 Fetch an image
 Fetch an audio clip
 Play an audio clip
 Resize the applet
 Additionally, the Applet class provides an
interface by which the viewer or browser
obtains information about the applet and
controls the applet’s execution. The viewer
may-
 Request information about the author,
version, and copyright of the applet.
 Request a description of the parameters the
applet recognizes.
 Initialize the applet
 Destroy the applet
 Start the applet’s execution
 Stop the applet’s execution
The Applet class provides default
implementations of each of these methods.
Those implementations may be overridden as
necessary.
Invoking an Applet
 An applet may be invoked by embedding
directives in an HTML file and viewing the file
through an applet viewer or java enabled
browser.
 The <applet> tag is the basis for embedding
an applet in an HTML file.
Example program
 Draw smiley in applet window using java applet class
method.
Import java.applet.Applet;
Import java.awt.*;
Public class smileyexe extendsApplet{
Public void paint(Graphics g){
g.Set color(color,yellow);
g.filloval(20,20,150,150);
g.Set color(color,black);
g.filloval(50,60,15,25);
g.Set color(color,black);
g.filloval(120,60,15,25);
Int x[ ]={95,85,106,95};
Int y[ ]={85,104,104,85};
g.drawpolygon(x,y,4);
g.DrawArc(55,95,78,50,0,-180);
g.drawLine(50,126,60,116);
g.drawLine(128,115,139,126);
}
}
/* <appletcode=“smiley class” width=“200” height=“200”>
</applet>
*/
Thank you

More Related Content

What's hot (20)

Java Applet
Java AppletJava Applet
Java Applet
 
Java applet - java
Java applet - javaJava applet - java
Java applet - java
 
Applet in java
Applet in javaApplet in java
Applet in java
 
JAVA APPLETS
JAVA APPLETSJAVA APPLETS
JAVA APPLETS
 
Java applets
Java appletsJava applets
Java applets
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Java applets
Java appletsJava applets
Java applets
 
Java applets
Java appletsJava applets
Java applets
 
Appl clas nd architect.56
Appl clas nd architect.56Appl clas nd architect.56
Appl clas nd architect.56
 
Java Applets
Java AppletsJava Applets
Java Applets
 
L18 applets
L18 appletsL18 applets
L18 applets
 
Java applets
Java appletsJava applets
Java applets
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
 
Applet execution
Applet execution Applet execution
Applet execution
 
Java
JavaJava
Java
 
Java applet
Java appletJava applet
Java applet
 
Java applets and working principles
Java applets and working principlesJava applets and working principles
Java applets and working principles
 
Applet init nd termination.59
Applet init nd termination.59Applet init nd termination.59
Applet init nd termination.59
 
java Applet Introduction
java Applet Introductionjava Applet Introduction
java Applet Introduction
 
Class notes(week 10) on applet programming
Class notes(week 10) on applet programmingClass notes(week 10) on applet programming
Class notes(week 10) on applet programming
 

Similar to Appletjava (20)

Class notes(week 10) on applet programming
Class notes(week 10) on applet programmingClass notes(week 10) on applet programming
Class notes(week 10) on applet programming
 
Java applet
Java appletJava applet
Java applet
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
 
oops with java modules iii & iv.pptx
oops with java modules iii & iv.pptxoops with java modules iii & iv.pptx
oops with java modules iii & iv.pptx
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
 
Basic of Applet
Basic of AppletBasic of Applet
Basic of Applet
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
 
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
 
Java Applets
Java AppletsJava Applets
Java Applets
 
Applet in java new
Applet in java newApplet in java new
Applet in java new
 
Applet
AppletApplet
Applet
 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
 
applet.pptx
applet.pptxapplet.pptx
applet.pptx
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
 
3. applets
3. applets3. applets
3. applets
 
UNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdfUNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdf
 

More from DEEPIKA T

71619109 configuration-management.pdf (1) (1)
71619109 configuration-management.pdf (1) (1)71619109 configuration-management.pdf (1) (1)
71619109 configuration-management.pdf (1) (1)DEEPIKA T
 
Parallelizing matrix multiplication
Parallelizing  matrix multiplicationParallelizing  matrix multiplication
Parallelizing matrix multiplicationDEEPIKA T
 
Health care in big data analytics
Health care in big data analyticsHealth care in big data analytics
Health care in big data analyticsDEEPIKA T
 
Role of human interaction
Role of human interactionRole of human interaction
Role of human interactionDEEPIKA T
 
Basic analtyics &amp; advanced analtyics
Basic analtyics &amp; advanced analtyicsBasic analtyics &amp; advanced analtyics
Basic analtyics &amp; advanced analtyicsDEEPIKA T
 
Soap,Rest&Json
Soap,Rest&JsonSoap,Rest&Json
Soap,Rest&JsonDEEPIKA T
 
Remote method invocation
Remote  method invocationRemote  method invocation
Remote method invocationDEEPIKA T
 
Graph representation
Graph representationGraph representation
Graph representationDEEPIKA T
 
Presentation2
Presentation2Presentation2
Presentation2DEEPIKA T
 
Depth first search [dfs]
Depth first search [dfs]Depth first search [dfs]
Depth first search [dfs]DEEPIKA T
 
Topological sort
Topological sortTopological sort
Topological sortDEEPIKA T
 
Path compression
Path compressionPath compression
Path compressionDEEPIKA T
 

More from DEEPIKA T (20)

See
SeeSee
See
 
71619109 configuration-management.pdf (1) (1)
71619109 configuration-management.pdf (1) (1)71619109 configuration-management.pdf (1) (1)
71619109 configuration-management.pdf (1) (1)
 
80068
8006880068
80068
 
242296
242296242296
242296
 
Data mining
Data miningData mining
Data mining
 
Parallelizing matrix multiplication
Parallelizing  matrix multiplicationParallelizing  matrix multiplication
Parallelizing matrix multiplication
 
Health care in big data analytics
Health care in big data analyticsHealth care in big data analytics
Health care in big data analytics
 
Ajax
AjaxAjax
Ajax
 
Role of human interaction
Role of human interactionRole of human interaction
Role of human interaction
 
Basic analtyics &amp; advanced analtyics
Basic analtyics &amp; advanced analtyicsBasic analtyics &amp; advanced analtyics
Basic analtyics &amp; advanced analtyics
 
Soap,Rest&Json
Soap,Rest&JsonSoap,Rest&Json
Soap,Rest&Json
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
 
Jdbc ja
Jdbc jaJdbc ja
Jdbc ja
 
Remote method invocation
Remote  method invocationRemote  method invocation
Remote method invocation
 
Graph representation
Graph representationGraph representation
Graph representation
 
Al
AlAl
Al
 
Presentation2
Presentation2Presentation2
Presentation2
 
Depth first search [dfs]
Depth first search [dfs]Depth first search [dfs]
Depth first search [dfs]
 
Topological sort
Topological sortTopological sort
Topological sort
 
Path compression
Path compressionPath compression
Path compression
 

Recently uploaded

PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 

Appletjava

  • 1. RENUGADEVI.S, MSC.,CS NADAR SARASWATHI COLLEGE OF ARTS AND SCINCE. THENI. applet
  • 2. What is applet?  An applet is a java program that can be embedded into a webpage. It runs inside the web browser and works at client side.  An applet is embedded in an HTML page using the applet or object tag and hosted on a web server.  Applet are used to make the website more dynamic and entertaining.
  • 3. Important points about Applet 1. All applets are sub-classes(either directly or indirectly) of java.applet.Applet class. 2. Applet are not stand-alone programs. Instead, they run within either a web browser or an applet viewer. JDK provides a standard applet viewer tool called applet viewer. 3. In general, execution of an applet does not begin at main() method.
  • 4. 4. Output of an applet window is not performed by System.out.println(). 5. Rather with various AWT methods, such as drawString().
  • 5. Life cycle of an applet
  • 6.  It is important to understand the order in which the various methods shown in the above image are called. When an applet begins, the following methods are called, in this sequence: 1.init() 2.start() 3.paint()
  • 7.  When an applet is terminated, the following sequence of method calls takes place: 1.stop() 2.destory()  init() The init() method is the first method to be called. Where you should initialize variables. This method is called only once during the runtime of applet.
  • 8. Start(): The start() method is called after init(). It is also called to restart an applet after it has been stopped. Note that init() is called once. i.e.,When the first time an applet is loaded whereas start() is called each time an applet’s HTML document is displayed onscreen. So, if a user leaves a web page and comes back, the applet resumes execution at start().
  • 9. Paint(): The paint() method is called each time an AWT-based applet’s output must be redrawn. This situation can occur for several reasons. For example, the window in which the applet is running may be overwritten by another window and then uncovered. ORThe applet window may be minimized and then restored.
  • 10.  Paint() is also called when the applet begins execution. Whatever the cause, whenever the applet must redraw its output, paint() is called.  paint() method has one parameter of type Graphics. This parameter will contain the graphics context, which describes the graphics environment in which the applet is running.
  • 11. Stop(): The stop() method is called when a web browser leaves the HTML document containing the applet-when it goes to another page, example: When stop() is called, the applet is probably running. Use stop() to suspend threads that don’t need to run when the applet is not visible. Restart them when start() is called if the user returns to the page.
  • 12. destroy(): The destroy() method is called when the environment determines that applet needs to be removed completely from memory. At this point , should free up any resources the applet may be using. The stop() method is always called before destroy().
  • 13. CREATING AN EXECUTABLE APPLET  Executable applet is nothing but the .class file of the applet, which is obtained by compiling the source code of the applet. Compiling an applet is exactly the same as compiling an application. Therefore, we can use the
  • 14. The Applet class  Every applet is an extension of the java.applet.Applet class. The base Applet class provides methods that a derived Applet class may call to obtain information and services from the browser context.  These include methods that do the following-  Get applet parameters  Get the network location of the HTML file that contains the applet.
  • 15.
  • 16.  Get the network location of the applet class directory.  Print a status message in the browser  Fetch an image  Fetch an audio clip  Play an audio clip  Resize the applet
  • 17.  Additionally, the Applet class provides an interface by which the viewer or browser obtains information about the applet and controls the applet’s execution. The viewer may-  Request information about the author, version, and copyright of the applet.  Request a description of the parameters the applet recognizes.
  • 18.  Initialize the applet  Destroy the applet  Start the applet’s execution  Stop the applet’s execution The Applet class provides default implementations of each of these methods. Those implementations may be overridden as necessary.
  • 19. Invoking an Applet  An applet may be invoked by embedding directives in an HTML file and viewing the file through an applet viewer or java enabled browser.  The <applet> tag is the basis for embedding an applet in an HTML file.
  • 20. Example program  Draw smiley in applet window using java applet class method. Import java.applet.Applet; Import java.awt.*; Public class smileyexe extendsApplet{ Public void paint(Graphics g){ g.Set color(color,yellow); g.filloval(20,20,150,150); g.Set color(color,black); g.filloval(50,60,15,25); g.Set color(color,black); g.filloval(120,60,15,25); Int x[ ]={95,85,106,95}; Int y[ ]={85,104,104,85}; g.drawpolygon(x,y,4); g.DrawArc(55,95,78,50,0,-180);