-
Notifications
You must be signed in to change notification settings - Fork 0
/
app11.java
79 lines (56 loc) · 947 Bytes
/
app11.java
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
<applet code="app10" height="400" width="400">
</applet>
*/
import java.applet.*;
import java.awt.*;
public class app10 extends Applet
{
String msg1="HELLO";
String msg2="HII";
String msg3="WELCOME";
int x1=10;
int x2=10;
int x3=10;
int y=150;
int flag=0;
public void paint(Graphics g)
{
if(flag==0&&x1==350)
{
flag=1;
}
else if(flag==1&&x2==350)
{
flag=2;
}
else if(flag==2&x3==350)
{}
else if(flag==0)
{
g.drawString(msg1,x1,y);
g.drawString(msg2,x2,y+30);
g.drawString(msg3,x3,y+60);
x1++;
}
else if(flag==1)
{
g.drawString(msg2,x2,y+30);
g.drawString(msg3,x3,y+60);
x2++;
}
else if(flag==2)
{
g.drawString(msg3,x3,y+60);
x3++;
}
try
{
Thread.sleep(10);
}
catch(Exception e)
{
}
repaint();
}
}