Specifications

Sun Services
Java™ Programming Language
Module 10, slide 36 of 37
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Drawing in AWT
You can draw in any Component (although AWT
provides the Canvas and Panel classes just for this
purpose).
Typically, you create a subclass of Canvas or Panel and
override the paint method.
The paint method is called every time the component
is shown (for example, if another window overlapped
the component and was then removed).
Every component has a Graphics object.
The Graphics class implements many drawing
methods.