Skip to content

Commit 1448fe1

Browse files
Create AndroidLoading.java
1 parent 5ff670d commit 1448fe1

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

AndroidLoading.java

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*<applet code="AndroidLoading" width="1000" height="1000">
2+
</applet>*/
3+
import java.awt.*;
4+
import java.applet.*;
5+
public class AndroidLoading extends Applet implements Runnable
6+
{
7+
Thread t;
8+
int i,j=0,k=0,l,cx=0;
9+
boolean b=false;
10+
public void init()
11+
{
12+
t=new Thread(this);
13+
}
14+
public void start()
15+
{
16+
t.start();
17+
}
18+
public void paint(Graphics g)
19+
{
20+
g.drawArc(300,300,300,300,i+l,j);
21+
g.drawArc(299,299,302,302,i+l,j);
22+
23+
}
24+
public void run()
25+
{
26+
while(true)
27+
{
28+
29+
for(i=0;i<=360;i++)
30+
{
31+
repaint();
32+
try
33+
{
34+
t.sleep(5);
35+
}
36+
catch(Exception e)
37+
{
38+
}
39+
if(b==false)
40+
{
41+
if(j>=200)
42+
{
43+
b=true;
44+
cx=1;
45+
}
46+
if(cx>=3)
47+
{
48+
l++;
49+
}
50+
cx++;
51+
j++;
52+
53+
54+
55+
}
56+
else
57+
{
58+
if(j==0)
59+
{
60+
b=false;
61+
cx=0;
62+
}
63+
j--;
64+
if(cx>=3)
65+
{
66+
l++;
67+
}
68+
cx++;
69+
}
70+
71+
}
72+
}
73+
74+
75+
76+
77+
}
78+
}

0 commit comments

Comments
 (0)