-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFace.java
More file actions
45 lines (36 loc) · 1.47 KB
/
Face.java
File metadata and controls
45 lines (36 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.applet.Applet;
import java.awt.*;
public class Face extends Applet
{
public void paint (Graphics page)
{
// page.filloval(50, 30, 180, 180); ------------ CIRCLE
// | | | |
// page.drawArc (90, 150, 100, 40, 180, 180); --- ARC
// | | | | | |
// x y width | | |
// | | |
// height | |
// | |
// startAngle |
// |
// arcAngle
setBackground (Color.cyan); // background
page.setColor (Color.gray);
page.fillOval (50, 30, 180, 180); // face
page.setColor (Color.white);
page.fillOval (90, 90, 30, 30); // left eye
page.fillOval (160, 90, 30, 30); // right eye
page.setColor (Color.blue);
page.fillOval (95, 100, 10, 10); // left pupil
page.fillOval (165, 100, 10, 10); // right pupil
page.setColor (Color.black);
page.drawArc (90, 150, 100, 40, 180, 180); // mouth
page.setColor (Color.black);
page.drawArc (125, 130, 10, 10, 90, 180); // nose
page.drawArc (123, 80, 15, 50, 270, 90); // nose
page.setColor (Color.gray);
page.fillOval (30, 60, 50, 50); // ear left
page.fillOval (200, 60, 50, 50); // ear right
}
}