import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.undo.*; import javax.swing.event.*; import java.util.Vector; public class Ennistus extends JApplet implements ActionListener{ static Vector ringid=new Vector(); UndoManager ennistushaldur=new UndoManager(); Button edasi=new Button(">"); Button tagasi=new Button("<"); public Ennistus(){ getContentPane().add(tagasi, BorderLayout.WEST); getContentPane().add(edasi, BorderLayout.EAST); tagasi.addActionListener(this); edasi.addActionListener(this); addMouseListener( new MouseAdapter(){ public void mousePressed(MouseEvent e){ ennistushaldur.undoableEditHappened(new UndoableEditEvent( Ennistus.this, new LisatavRing(e.getX(), e.getY()) )); repaint(); } } ); } public void paint(Graphics g){ g.setColor(Color.white); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(Color.black); for(int i=0; i