java.awt.event.PaintEvent (JDK 1.1)
An event of this type indicates that a component should have its update() method invoked. (The update() method typically, by default, invokes the paint() method.)
PaintEvent differs from the other event types in java.awt.event in that it does not have a corresponding EventListener interface. PaintEvent is essentially for internal use by the AWT redisplay framework, so your programs should not try to handle it the way they handle other events. Instead, applets and custom components should simply override their paint() and/or update() methods to redraw themselves appropriately. AWT automatically invokes update() (which typically invokes paint()) when a PaintEvent arrives.
Although you do not typically use the PaintEvent, redraw events are implemented through this class for simplicity, so that they are on equal footing with other event types, and so that advanced programs can manipulate them through the EventQueue.
public classPaintEventextends ComponentEvent { //Public ConstructorpublicPaintEvent(Componentsource, intid, RectangleupdateRect); //Constantspublic static final intPAINT; public static final intPAINT_FIRST; public static final intPAINT_LAST; public static final intUPDATE; //Public Instance Methodspublic RectanglegetUpdateRect(); public StringparamString(); //Overrides ComponentEventpublic voidsetUpdateRect(RectangleupdateRect); }
Hierarchy:
Object->EventObject(Serializable)->AWTEvent->ComponentEvent->PaintEvent