SWING: ComponentEvent Class Cheat Sheet

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

public class ComponentEvent
   extends AWTEvent
# Field

Following are the fields for java.awt.Component class

  • static int COMPONENT_FIRST − The first number in the range of IDs used for component events.
  • static int COMPONENT_HIDDEN − This event indicates that the component was rendered invisible.
  • static int COMPONENT_LAST − The last number in the range of IDs used for component events.
  • static int COMPONENT_MOVED − This event indicates that the component’s position has changed.
  • static int COMPONENT_RESIZED − This event indicates that the component’s size has changed.
  • static int COMPONENT_SHOWN − This event indicates that the component was made visible.
# Constructors
ComponentEvent(Component source, int id)Constructs a ComponentEvent object.
# Methods
Component getComponent()Returns the originator of the event.
String paramString()Returns a parameter string identifying this event.
# Methods Inherited
  • java.awt.AWTEvent
  • java.util.EventObject
  • java.lang.Object

Leave a Reply

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