import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.awt.image.*; public class Pildiredaktor1 extends Applet implements MouseListener{ BufferedImage pilt=new BufferedImage(300, 300, BufferedImage.TYPE_INT_RGB); Graphics2D piltg=pilt.createGraphics(); public Pildiredaktor1(){ addMouseListener(this); } public void paint(Graphics g){ g.drawImage(pilt, 0, 0, this); } public void mousePressed(MouseEvent e){ piltg.drawOval(e.getX()-10, e.getY()-10, 20, 20); repaint(); } 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[] arg){ Frame f=new Frame(); f.add(new Pildiredaktor1()); f.setSize(200, 200); f.setVisible(true); } }