import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.awt.image.*; public class moina extends Applet implements ActionListener{ Image esimene=Toolkit.getDefaultToolkit().getImage("esimene.gif"); Image teine=Toolkit.getDefaultToolkit().getImage("teine.jpg"); Image neljas=Toolkit.getDefaultToolkit().getImage("neljas.gif"); Image kolmas=Toolkit.getDefaultToolkit().getImage("kolmas.jpg"); Button nupp=new Button(" Sisse "); public moina(){ setLayout(null); nupp.setBounds(383,300,53,20); add(nupp); nupp.addActionListener(this); } public void paint(Graphics g){ g.setColor(new Color(150,100,50)); g.fillRect(50,50,400,300); g.setColor(new Color(150,150,255)); g.fillRect(70,70,300,250); g.setColor(new Color(200,200,200)); g.fillRect(383,70,51,75); g.setColor(Color.black); g.drawRect(383,70,51,75); int x=386; for(int i=0;i<16;i++){ g.drawLine(x,70,x,145); x=x+3; } } public void actionPerformed(ActionEvent e){ BufferedImage malupilt=new BufferedImage(300, 250, BufferedImage.TYPE_INT_RGB); Graphics malug=malupilt.createGraphics(); Graphics g=this.getGraphics(); for(int i=1;i>0;i++){ malug.drawImage(esimene, 0, 0, 300, 250, this); g.drawImage(malupilt, 70, 70, this); try{Thread.sleep(2000);}catch(Exception viga){} malug.drawImage(teine, 0, 0, 300, 250, this); g.drawImage(malupilt, 70, 70, this); try{Thread.sleep(2000);}catch(Exception viga){} malug.drawImage(kolmas, 0, 0, 300, 250, this); g.drawImage(malupilt, 70, 70, this); try{Thread.sleep(2000);}catch(Exception viga){} malug.drawImage(neljas, 0, 0, 300, 250, this); g.drawImage(malupilt, 70, 70, this); try{Thread.sleep(2000);}catch(Exception viga){} } } public static void main(String argumendid[]){ Frame f=new Frame(); f.add(new moina()); f.setSize(500, 500); f.setVisible(true); } }