//------------------------------- NOTES --------------------------------/*    The EventTest applet from pages 245-6 of the text.        NOTE: We should warn you that when running this program you shouldn't be    surprised if some of the events are not reported.  As of this writing,    it's still a sad fact of life that some Java environments aren't as diligent    as they should be in generating and catching events. *///------------------------------ IMPORTS -------------------------------import java.awt.*;import java.awt.event.*;import java.applet.*;public class ET extends Applet{    private Button left, right;    private Display myDisplay;        public void init()    {    	setLayout(new BorderLayout());    	myDisplay = new Display();    	add("Center", myDisplay);    	    	Panel p = new Panel();    	left = new Button("Left");    	p.add(left);    	right = new Button("Right");    	p.add(right);    	add("South", p);    	    	left.addActionListener(myDisplay);        right.addActionListener(myDisplay);            }	}class Display extends Canvas implements ActionListener{	private Point center;		public Display()	{		center = new Point(50, 50);		setBackground(Color.white);	}		public void actionPerformed(ActionEvent e)	{		String direction = e.getActionCommand();		if (direction.equals("Left"))			center.x -= 12;		else if (direction.equals("Right"))			center.x += 12;		repaint();	}		public void paint(Graphics g)	{		g.setColor(Color.red);		g.fillOval(center.x - 5, center.y - 5, 10, 10);	}}