java.awt
Class Canvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
All Implemented Interfaces:
java.awt.image.ImageObserver

public class Canvas
extends Component

A Canvas component. This is a generic component which needs to be subclassed in order to add some interesting functionality.


Field Summary
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Canvas()
           
 
Method Summary
 void addNotify()
          Creates the peer of the canvas.
 void paint(Graphics g)
          Paints the canvas in the default background color.
 
Methods inherited from class java.awt.Component
action, bounds, checkImage, checkImage, createImage, createImage, deliverEvent, disable, enable, enable, getBackground, getColorModel, getFont, getFontMetrics, getForeground, getGraphics, getParent, getPeer, getToolkit, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isEnabled, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setFont, setForeground, show, show, size, toString, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Canvas

public Canvas()
Method Detail

addNotify

public void addNotify()
Creates the peer of the canvas. This peer allows you to change the user interface of the canvas without changing its functionality.

Overrides:
addNotify in class Component
See Also:
Component.getPeer(), Component.removeNotify()

paint

public void paint(Graphics g)
Paints the canvas in the default background color.

Overrides:
paint in class Component
Parameters:
g - the specified Graphics window
See Also:
Component.update(java.awt.Graphics)