Question

Write an applet to display (draw) a picture of a person with arms, legs, body, and...

Write an applet to display (draw) a picture of a person with arms, legs, body, and head.

Also draw eyes, eyebrows and a nose on the picture.

Use a happy face for the head and use ovals for them. Don’t hesitate to be creative. There are two kinds of methods for oval. The methods drawOval for an empty oval and fillOval for a filled oval (to fill it with a color) hat are available in JDK.

On the top part of the applet show a caption like “My rendition of a person” and in the next line show current date.

Note: Do not display a real picture(gif file) on applet. You need to write a program to draw a person on the applet.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Source Code:

import java.awt.*;
import java.applet.*;
public class face extends Applet
{
    public void paint(Graphics g)
    {
        g.drawOval(40, 40, 120, 150);
        g.drawOval(57, 75, 30, 20);
        g.drawOval(110, 75, 30, 20);
        g.fillOval(68, 81, 10, 10);
        g.fillOval(121, 81, 10, 10);
        g.drawOval(85, 100, 30, 30);
        g.fillArc(60, 125, 80, 40, 180, 180);
        g.drawOval(25, 92, 15, 30);
        g.drawOval(160, 92, 15, 30);
    }

}

Program Screenshot:

output screenshot:

​​​​​​

Add a comment
Know the answer?
Add Answer to:
Write an applet to display (draw) a picture of a person with arms, legs, body, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • can this code be provided? Project #3 Introduction As you wrap up with JavaScript, let's put...

    can this code be provided? Project #3 Introduction As you wrap up with JavaScript, let's put together everything you've learned to make the classic game "Hangman" in a webpage. If you are unfamiliar with the rules of Hangman, the game works like this: A gallows is drawn on a surface, and Player 1 chooses a word that player 2 must guess. Empty dashes for each letter in the word are drawn next to the gallows (so a 7-letter word means...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT