import java.awt.*;
public class tsisu extends Canvas{
Image pilt;
Graphics piltg;

public void init(){
//pilt=createImage(200, 200);
//if(pilt==null)System.out.println(" alg Tuhi");
// piltg=pilt.getGraphics();
}
public void joonista_ring(int x, int y, boolean pihtas){
 piltg=pilt.getGraphics();
 if(pihtas){piltg.setColor(Color.red);
 piltg.fillOval(x-3, y-3, 6, 6);}
 else {piltg.setColor(Color.black);
 piltg.drawOval(x-3, y-3, 6, 6);}

 repaint();
}

public void paint(Graphics g){
if(pilt==null){System.out.println("Tuhi");
pilt=createImage(400, 150);
piltg=pilt.getGraphics();
if(pilt==null)System.out.println("Ikka tuhi");
}

 g.drawImage(pilt, 0, 0, null);
}

}
