import java.awt.*; import java.awt.event.*; import java.applet.Applet; public class Hiirevajutus3 extends Applet implements MouseListener, ActionListener{ int x=100; int y=100; int d=20; int n=5; int vahe=10; TextField tf1=new TextField(String.valueOf(d)); TextField tf2=new TextField(String.valueOf(n)); TextField tf3=new TextField(String.valueOf(vahe)); //Soovin saada juurde ruudu suuruse //määramise võimaluse public Hiirevajutus3(){ add(new Label("Sisemine:")); add(tf1); add(new Label("Kogus:")); add(tf2); add(new Label("Vahe:")); add(tf3); addMouseListener(this); tf1.addActionListener(this); tf2.addActionListener(this); tf3.addActionListener(this); } public void actionPerformed(ActionEvent e){ d=Integer.parseInt(tf1.getText()); n=Integer.parseInt(tf2.getText()); vahe=Integer.parseInt(tf3.getText()); repaint(); } public void paint(Graphics g){ int a=d; for(int i=0; i