-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplet3.java
More file actions
40 lines (36 loc) · 871 Bytes
/
Copy pathapplet3.java
File metadata and controls
40 lines (36 loc) · 871 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
32
33
34
35
36
37
38
39
40
import java.applet.Applet;
import java.awt.*;
public class applet3 extends Applet
{
boolean a = true;
public void paint(Graphics g)
{
g.setColor(Color.yellow);
g.fillOval(500, 200, 300, 300);
g.setColor(Color.black);
g.fillOval(565, 275, 60, 60);
g.fillOval(675, 275, 60, 60);
if (a)
{
g.setColor(Color.pink);
g.fillArc(575, 360, 150, 100, 180, 180);
a = false;
}
else
{
g.setColor(Color.black);
g.drawArc(575, 360, 150, 100, 0, 180);
a = true;
}
try
{
Thread.sleep(1000);
}
catch(InterruptedException e) {};
repaint();
}
}
/*
<applet code="Smiley_Face.class" width="400" height="400">
</applet>
*/