1import java.awt.*;
2import java.applet.*;
3
4
5
6public
7class Mensch
8 extends Applet
9 implements Runnable {
10
11 int startx, starty;
12 int i;
13
14 Thread mensch = null;
15
16
17
18 public
19 void init() {
20 startx = 10;
21 starty = 10;
22 }
23
24
25
26 public
27 void start() {
28 if ( mensch == null ) {
29 mensch = new Thread ( this );
30 mensch.start();
31 }
32 }
33
34
35
36 public
37 void stop() {
38 if ( mensch != null ) {
39 mensch.stop();
40 mensch = null;
41 }
42 }
43
44
45
46 public void run() {
47 while ( true ) {
48 for ( i = 0; i < 10; i++ ) {
49 repaint();
50 try { mensch.sleep(100); }
51 catch ( InterruptedException e ) {}
52 }
53 for ( ; i > 0; i-- ) {
54 repaint();
55 try { mensch.sleep(100); }
56 catch ( InterruptedException e ) {}
57 }
58 }
59 }
60
61
62
63 public void paint ( Graphics g )
64 {
65 int x = startx + 2*i;
66 int y = starty + i;
67
68
69 g.drawLine ( x, y, x+70, y );
70 g.drawLine ( x, y, x, y+100 );
71
72 g.drawOval ( x+22, y+4, 16, 18 );
73 g.drawLine ( x+29, y+13, x+27, y+17 );
74 g.drawLine ( x+27, y+17, x+29, y+17 );
75 g.drawOval ( x+27, y+10, 1, 2 );
76 g.drawOval ( x+33, y+10, 1, 2 );
77
78 g.drawLine ( x+30, y+22, x+30, y+50 );
79 g.drawLine ( x+30, y+50, x+20, y+90 );
80 g.drawLine ( x+30, y+50, x+40, y+90 );
81 g.drawLine ( x+40, y+90, x+45, y+90 );
82 g.drawLine ( x+20, y+90, x+15, y+90 );
83 g.drawLine ( x+30, y+30, x, y+27 );
84 g.drawLine ( x+30, y+30, x+33, y+30 );
85
86
87 g.drawLine ( x+33, y+30, x+60-i, y+27-3*i+10);
88 }
89
90}
91
92