Share via


Component.update

Class Overview | Class Members | This Package | All Packages

Syntax

public void update( Graphics g )

Parameters
  • g
    the specified context to use for updating.
Description

Updates this component.

The AWT calls the update method in response to a call to repaint. The appearance of the component on the screen has not changed since the last call to update or paint. You can assume that the background is not cleared.

The updatemethod of Component does the following:

  • Clears this component by filling it with the background color.
  • Sets the color of the graphics context to be the foreground color of this component.
  • Calls this component's paint method to completely redraw this component.

The origin of the graphics context, its (00) coordinate point, is the top-left corner of this component. The clipping region of the graphics context is the bounding rectangle of this component.

See Also

paint, repaint