home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Java AWT

Previous Chapter 19
java.awt Reference
Next
 

Canvas

Name

Canvas

[Graphic: Figure from the text]

Description

Canvas is a Component that provides a drawing area and is often used as a base class for new components.

Class Definition

public class java.awt.Canvas
    extends java.awt.Component {
  
  // Constructors
  public Canvas();
  
  // Instance Methods
  public void addNotify();
  public void paint (Graphics g);
}

Constructors

Canvas

public Canvas()

Description

Constructs a Canvas object.

Instance Methods

addNotify

public void addNotify()

Overrides

Component.addNotify()

Description

Creates Canvas's peer.

paint

public void paint (Graphics g)

Parameters

g

Graphics context of component.

Description

Empty method to be overridden in order to draw something in graphics context.

See Also

Component, Graphics


Previous Home Next
Button Book Index CardLayout

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java