CSCI111, Lab4 Achim Karger 2/28/2008 The function paint() is a method of the Applet class that allows to draw in a graphics context. By overriding the generic paint method in the Applet class the programmer can create his or her own graphics. For this purpose the paint method provides a Graphics object in the form of an argument to the paint function. The graphics object offers a number of draw methods like and drawoval() drawstring() to draw various forms and text. Paint is called by the web page anytime the applet window is opened, resized or moved requiring a new rendering of the graphics contend on the screen. From within the program , the paint method is called by innvoking g.repaint() where g is the graphics object. The if-statement probes the value of the data member figure, to determine what kind of figure should be drawn. Valid values include "Circle" or "Rectangle" . This particular if statement probes for the value "Circle" or anything else and branches on that condition to either draw a circle or a rectangle (default) figure, x,y, width and height are members of the ComputeFigure class. Their values determine the type of figure (circle or rectangle), location(x,y) and size (width and height) drawn on the screen. ButtonHandler class describes the action events for the buttons. It implements the ActionListerer interface TheMouseHandler describes mouse action events. It implements the MouseMotoinListeren interface and is derived by extending the MouseAdapter class.