# Applet program in java to draw a face

- Link: https://technotaught.com/applet-program-in-java-to-draw-a-face/
- Published: 2019-07-24T21:14:17+05:30
- Author: Ashishkumar Vishwakarma

First, we do three things to make an applet program in [java](https://technotaught.com/registration-form-in-windows-form-using-swing-in-java/)
to draw a face

 * Create three Ovals, one in the face, two for the eyes.

 * Fill eyes, oval with black color.

 * Create an arc for the smile in the face.

Also, you can use the Java [compiler](https://www.onlinegdb.com/online_java_compiler)
[](https://www.onlinegdb.com/online_java_compiler) to compile a program.

## Applet program in Java to draw a face

#### Implementation.

    ```javascript
    Import java.awt.*;
    import java.applet.*;

    public class smiley extends Applet
    {
    /* <applet code = "smiley" width = 300 height = 300> </applet> */	
    	public void paint(Graphics g){

    		Font f = new Font("Helvetica", Font.BOLD,20);
    		g.setFont(f);
    		g.drawString("Keep Smiling!!!", 50, 30);
    		g.drawOval(60, 60, 200, 200);
    		g.fillOval(90, 120, 50, 20);
    		g.fillOval(190, 120, 50, 20);
    		g.drawLine(165, 125, 165, 175);
    		g.drawArc(110, 130, 95, 95, 0, -180);
    	}
    }
    ```

#### Output:

In the command line.

    ```wp-block-preformatted
     C:\A>  smiley.java
     C:\A>  smiley.html
    ```

Also View:[ – Write a program to create a registration form using AWT](https://technotaught.com/registration-form/).

Also View- [Write a java program to create a window using swing.](https://technotaught.com/22-write-a-java-program-to-create-a-window-using-swing/)

### Share this:

 * [  X ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=twitter)
 * [  Facebook ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=facebook)
 * [More](https://technotaught.com/applet-program-in-java-to-draw-a-face/#)

 * [  WhatsApp ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=jetpack-whatsapp)
 * [  LinkedIn ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=linkedin)
 * [  Email ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?subject=%5BShared%20Post%5D%20Applet%20program%20in%20java%20to%20draw%20a%20face&body=https%3A%2F%2Ftechnotaught.com%2Fapplet-program-in-java-to-draw-a-face%2F&share=email)
 * [  Reddit ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=reddit)
 * [  Tumblr ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=tumblr)
 * [  Pinterest ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=pinterest)
 * [  Telegram ](https://technotaught.com/applet-program-in-java-to-draw-a-face/?share=telegram)
 * [  Print ](https://technotaught.com/applet-program-in-java-to-draw-a-face/#print?share=print)

### _Related_

## Comments

### By: Melissa B

- Link: https://technotaught.com/applet-program-in-java-to-draw-a-face/#comment-136
- Published: 2020-04-24T02:44:40+05:30

Good way of describing, and nice piece of writing to get data on the topic of my
presentation subject, which i am going to deliver in college.\|
