-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmily_face.java
More file actions
31 lines (25 loc) · 837 Bytes
/
Smily_face.java
File metadata and controls
31 lines (25 loc) · 837 Bytes
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.applet.*;
import java.awt.*;
public class Smily_face extends Applet {
public void paint(Graphics g) {
g.setColor(Color.yellow);
g.fillOval(20,20,150,150); // For face
g.setColor(Color.black);
g.fillOval(50,60,15,25); // Left Eye
g.fillOval(120,60,15,25); // Right Eye
int x[] = {95,85,106,95};
int y[] = {85,104,104,85};
g.drawPolygon(x, y, 4); // Nose
g.drawArc(55,95,78,50,0,-180); // Smile
g.drawLine(50,126,60,116); // Smile arc1
g.drawLine(128,115,139,126); // Smile arc2
}
}
/* <applet code="SmileyExc.class" width="200" height="200">
</applet>
*/