All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.Component | +----java.awt.Canvas
Canvas
component represents a blank rectangular
area of the screen onto which the application can draw or from
which the application can trap input events from the user.
An application must subclass the Canvas
class in
order to get useful functionality such as creating a custom
component. The paint
method must be overridden
in order to perform custom graphics on the canvas.
public Canvas()
public void addNotify()
public void paint(Graphics g)
Canvas
should override this method in
order to perform some useful operation.
The paint
method provided by Canvas
redraws this canvas's rectangle in the background color.
The graphics context's origin (0, 0) is the top-left corner of this canvas. Its clipping region is the area of the context.
All Packages Class Hierarchy This Package Previous Next Index