Almost all drawing is accomplished by specifying locations within the drawing area using Cartesian coordinates. For example, to place some text at a specific place on the screen, the applet must provide the horizontal (x) and vertical (y) coordinates of the point where the lower left corner of the first letter in the text should be placed.
The coordinate system used differs from the common Cartesian coordinate systems in that the orientation of the y axis is upside down. Locations near the bottom of the screen have larger y coordinates than positions near the top of the screen. This difference is illustrated by the figure below which compares the normal Cartesian coordinate system to the coordinate system used to draw within an applet.
To make sure you have a clear idea of how the coordinate system works,
an applet is provided on the right side of your web broswer which displays the
(x,y) coordinate pair describing the current position of the mouse
whenever the mouse is clicked within the applet. As you move the
mouse to the upper left corner of the rectangle corresponding to the
applet, you will notice that the coordinates become closer and closer
to (0,0). On the other hand, the lower right corner of the applet
rectangle corresponds to the largest x and y coordinate values (the
actual maximum values vary with the size of the region specified in
the applet tag).