import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class HiirPall2 extends Applet implements MouseListener{ Image pilt=Toolkit.getDefaultToolkit().getImage("juku.gif"); public HiirPall2(){ addMouseListener(this); } public void mousePressed(MouseEvent e){ new Pall(e.getX(), e.getY()); } class Pall extends Thread{ int x, y; Graphics g=HiirPall2.this.getGraphics(); public Pall(int uus_x, int uus_y){ x=uus_x; y=uus_y; start(); } public void run(){ while(y<200){ g.drawImage(pilt, x, y, null); try{Thread.sleep(100);}catch(Exception erind){} g.setColor(Color.white); g.fillRect(x, y, 30, 56); y=y+3; } } } public void mouseReleased(MouseEvent e){} public void mouseClicked(MouseEvent e){} public void mouseEntered(MouseEvent e){} public void mouseExited(MouseEvent e){} public static void main(String[] argumendid){ Frame f=new Frame(); f.add(new HiirPall2()); f.setSize(200, 200); f.setVisible(true); } }