SWING: PaintEvent Class Cheat Sheet

Following is the declaration for java.awt.event.PaintEvent class

public class PaintEvent
   extends ComponentEvent
# Field

Following are the fields for java.awt.Component class

  • static int PAINT − The paint event type.
  • static int PAINT_FIRST − Marks the first integer ID for the range of paint event IDs.
  • static int PAINT_LAST − Marks the last integer ID for the range of paint event IDs.
  • static int UPDATE − The update event type.
# Constructors
PaintEvent(Component source, int id, Rectangle updateRect)Constructs a PaintEvent object with the specified source component and type.

Class Methods

Rectangle getUpdateRect()Returns the rectangle representing the area that 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 that needs to be repainted in response to this event.
# Methods Inherited
  • java.awt.ComponentEvent
  • java.awt.AWTEvent
  • java.util.EventObject
  • java.lang.Object

Leave a Reply

Your email address will not be published. Required fields are marked *