import java.awt.*; import java.awt.event.*; import java.applet.Applet; import java.lang.*; public class Lift extends Applet implements ActionListener, Runnable{ int m=50; //lift1 kõrgus// int o=260; //lift2 kõrgus// int s=80; // korruse atribuut// int x=0; int y=0; Button nupp9=new Button(" 9 "); Button nupp8=new Button(" 8 "); Button nupp7=new Button(" 7 "); Button nupp6=new Button(" 6 "); Button nupp5=new Button(" 5 "); Button nupp4=new Button(" 4 "); Button nupp3=new Button(" 3 "); Button nupp2=new Button(" 2 "); Button nupp1=new Button(" 1 "); public Lift(){ add(nupp1); add(nupp2); add(nupp3); add(nupp4); add(nupp5); add(nupp6); add(nupp7); add(nupp8); add(nupp9); nupp1.addActionListener(this); nupp2.addActionListener(this); nupp3.addActionListener(this); nupp4.addActionListener(this); nupp5.addActionListener(this); nupp6.addActionListener(this); nupp7.addActionListener(this); nupp8.addActionListener(this); nupp9.addActionListener(this); } public void paint(Graphics g){ g.setColor(Color.black); g.drawRect(50,50, 270, 270); //maja// int a=1; int b=30; g.drawLine(50, 80, 320, 80); //sein 9 g.drawLine(50, 110, 320, 110); //sein 8 g.drawLine(50, 140, 320, 140); //sein 7 g.drawLine(50, 170, 320, 170); //sein 6 g.drawLine(50, 200, 320, 200); //sein 5 g.drawLine(50, 230, 320, 230); //sein 4 g.drawLine(50, 260, 320, 260); //sein 3 g.drawLine(50, 290, 320, 290); //sein 2 g.drawRect(50, m, 25, 30); //lift1// g.drawRect(295, o, 25, 30); //lift2// } public void run(){ while(m!=s||o!=s){ try{Thread.sleep(300);} catch(Exception viga){} if(m>s) { x=m-s; } else { x=s-m; } if (o>s) { y=o-s; } else { y=s-o; } if(xs){ m-=10; } else { if(ms){ o-=10; } else { if(o