public class

PaintEvent

extends ComponentEvent
java.lang.Object
   ↳ java.util.EventObject
     ↳ java.awt.AWTEvent
       ↳ java.awt.event.ComponentEvent
         ↳ java.awt.event.PaintEvent
Known Direct Subclasses

Class Overview

The component-level paint event. This event is a special type which is used to ensure that paint/update method calls are serialized along with the other events delivered from the event queue. This event is not designed to be used with the Event Listener model; programs should continue to override paint/update methods in order render themselves properly.

Summary

Constants
int PAINT The paint event type.
int PAINT_FIRST Marks the first integer id for the range of paint event ids.
int PAINT_LAST Marks the last integer id for the range of paint event ids.
int UPDATE The update event type.
[Expand]
Inherited Constants
From class java.awt.event.ComponentEvent
From class java.awt.AWTEvent
[Expand]
Inherited Fields
From class java.awt.AWTEvent
From class java.util.EventObject
Public Constructors
PaintEvent(Component source, int id, Rectangle updateRect)
Constructs a PaintEvent object with the specified source component and type.
Public Methods
Rectangle getUpdateRect()
Returns the rectangle representing the area which needs to be repainted in response to this event.
String paramString()
Returns a parameter string identifying this event.
void setUpdateRect(Rectangle updateRect)
Sets the rectangle representing the area which needs to be repainted in response to this event.
[Expand]
Inherited Methods
From class java.awt.event.ComponentEvent
From class java.awt.AWTEvent
From class java.util.EventObject
From class java.lang.Object

Constants

public static final int PAINT

The paint event type.

Constant Value: 800 (0x00000320)

public static final int PAINT_FIRST

Marks the first integer id for the range of paint event ids.

Constant Value: 800 (0x00000320)

public static final int PAINT_LAST

Marks the last integer id for the range of paint event ids.

Constant Value: 801 (0x00000321)

public static final int UPDATE

The update event type.

Constant Value: 801 (0x00000321)

Public Constructors

public PaintEvent (Component source, int id, Rectangle updateRect)

Constructs a PaintEvent object with the specified source component and type.

Note that passing in an invalid id results in unspecified behavior. This method throws an IllegalArgumentException if source is null.

Parameters
source the object where the event originated
id the event type
updateRect the rectangle area which needs to be repainted
Throws
IllegalArgumentException if source is null

Public Methods

public Rectangle getUpdateRect ()

Returns the rectangle representing the area which needs to be repainted in response to this event.

public String paramString ()

Returns a parameter string identifying this event. This method is useful for event-logging and for debugging.

Returns
  • a string identifying the event and its attributes

public void setUpdateRect (Rectangle updateRect)

Sets the rectangle representing the area which needs to be repainted in response to this event.

Parameters
updateRect the rectangle area which needs to be repainted