Most often the graphics context is obtained from the Java window manager as a result of a painting request. This context is passed to your component's paint() or update() method. (Java also allows the user to obtain a graphics context for an offscreen image, which enables you to do double buffering. It is not necessary that you know what double buffering means, but you can find out from most any book on graphics and programming.)
The coordinate system is laid out with (0, 0) at the top left corner of the
drawing area with the x's and y's increasing until they get to
the applet's width and height. The coordinates are measured in pixels,
with x increasing horizontal to the right and y increasing vertically down
(not up!).