Packages This Package Prev Next Index
public class java.awt.Canvas
extends java.awt.Component (II-§1.10)
{
// Constructors
public Canvas(); §1.3.1
// Methods
public void addNotify(); §1.3.2
public void paint(Graphics g); §1.3.3
}
A 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 (II-§1.3.3) must be overridden in order to perform custom graphics on the canvas.
The AWT sends the canvas all mouse, keyboard, and focus events that occur over it. The gotFocus (II-§1.10.21), lostFocus (II-§1.10.39), keyDown (II-§1.10.31) , keyUp (II-§1.10.32), mouseEnter (II-§1.10.43) , mouseExit (II-§1.10.44), mouseMove (II-§1.10.45), mouseDrag (II-§1.10.42), mouseDown (II-§1.10.41) , and mouseUp (II-§1.10.46) methods may be overridden in order to catch user events.
public Canvas()
public void addNotify()
public void paint(Graphics g)
point is the top-left corner of this canvas. Its
clipping region is the area of the context.
g
- the graphics context
Packages This Package Prev Next IndexJava API Document (HTML generated by dkramer on April 22, 1996)