import java.io.*; import java.awt.*; import java.awt.event.*; import java.applet.Applet; public class Lift extends Applet implements ActionListener { int mitmendal1 = 3; int mitmendal2 = 7; 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() { Panel alaOsa = new Panel(new GridLayout(9, 1)); alaOsa.add(nupp9); alaOsa.add(nupp8); alaOsa.add(nupp7); alaOsa.add(nupp6); alaOsa.add(nupp5); alaOsa.add(nupp4); alaOsa.add(nupp3); alaOsa.add(nupp2); alaOsa.add(nupp1); nupp9.addActionListener(this); nupp8.addActionListener(this); nupp7.addActionListener(this); nupp6.addActionListener(this); nupp5.addActionListener(this); nupp4.addActionListener(this); nupp3.addActionListener(this); nupp2.addActionListener(this); nupp1.addActionListener(this); setLayout(new BorderLayout()); add(alaOsa, BorderLayout.EAST); } public void paint(Graphics g) { g.drawLine(50, 0, 50, 450); g.drawLine(70, 0, 70, 450); g.drawLine(100, 0, 100, 450); g.drawLine(120, 0, 120, 450); for (int alla=0;alla<=450;alla=alla+50) g.drawLine(50, alla, 70, alla); for (int alla=0;alla<=450;alla=alla+50) g.drawLine(100, alla, 120, alla); g.fillRect(52,(9-mitmendal1)*50+2,16,46); g.fillRect(102,(9-mitmendal2)*50+2, 16, 46); } public void actionPerformed(ActionEvent e) { if(e.getSource() == nupp9) KutsuLift(9); if(e.getSource() == nupp8) KutsuLift(8); if(e.getSource() == nupp7) KutsuLift(7); if(e.getSource() == nupp6) KutsuLift(6); if(e.getSource() == nupp5) KutsuLift(5); if(e.getSource() == nupp4) KutsuLift(4); if(e.getSource() == nupp3) KutsuLift(3); if(e.getSource() == nupp2) KutsuLift(2); if(e.getSource() == nupp1) KutsuLift(1); } public void KutsuLift(int korrus) { if(Math.abs(mitmendal1-korrus)