src/share/classes/java/awt/event/ComponentEvent.java

Print this page




  43  * In addition to serving as the base class for other component-related
  44  * events (InputEvent, FocusEvent, WindowEvent, ContainerEvent),
  45  * this class defines the events that indicate changes in
  46  * a component's size, position, or visibility.
  47  * <P>
  48  * This low-level event is generated by a component object (such as a
  49  * List) when the component is moved, resized, rendered invisible, or made
  50  * visible again. The event is passed to every <code>ComponentListener</code>
  51  * or <code>ComponentAdapter</code> object which registered to receive such
  52  * events using the component's <code>addComponentListener</code> method.
  53  * (<code>ComponentAdapter</code> objects implement the
  54  * <code>ComponentListener</code> interface.) Each such listener object
  55  * gets this <code>ComponentEvent</code> when the event occurs.
  56  * <p>
  57  * An unspecified behavior will be caused if the {@code id} parameter
  58  * of any particular {@code ComponentEvent} instance is not
  59  * in the range from {@code COMPONENT_FIRST} to {@code COMPONENT_LAST}.
  60  *
  61  * @see ComponentAdapter
  62  * @see ComponentListener
  63  * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
  64  *
  65  * @author Carl Quinn
  66  * @since 1.1
  67  */
  68 public class ComponentEvent extends AWTEvent {
  69 
  70     /**
  71      * The first number in the range of ids used for component events.
  72      */
  73     public static final int COMPONENT_FIRST             = 100;
  74 
  75     /**
  76      * The last number in the range of ids used for component events.
  77      */
  78     public static final int COMPONENT_LAST              = 103;
  79 
  80    /**
  81      * This event indicates that the component's position changed.
  82      */
  83     @Native public static final int COMPONENT_MOVED     = COMPONENT_FIRST;




  43  * In addition to serving as the base class for other component-related
  44  * events (InputEvent, FocusEvent, WindowEvent, ContainerEvent),
  45  * this class defines the events that indicate changes in
  46  * a component's size, position, or visibility.
  47  * <P>
  48  * This low-level event is generated by a component object (such as a
  49  * List) when the component is moved, resized, rendered invisible, or made
  50  * visible again. The event is passed to every <code>ComponentListener</code>
  51  * or <code>ComponentAdapter</code> object which registered to receive such
  52  * events using the component's <code>addComponentListener</code> method.
  53  * (<code>ComponentAdapter</code> objects implement the
  54  * <code>ComponentListener</code> interface.) Each such listener object
  55  * gets this <code>ComponentEvent</code> when the event occurs.
  56  * <p>
  57  * An unspecified behavior will be caused if the {@code id} parameter
  58  * of any particular {@code ComponentEvent} instance is not
  59  * in the range from {@code COMPONENT_FIRST} to {@code COMPONENT_LAST}.
  60  *
  61  * @see ComponentAdapter
  62  * @see ComponentListener
  63  * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
  64  *
  65  * @author Carl Quinn
  66  * @since 1.1
  67  */
  68 public class ComponentEvent extends AWTEvent {
  69 
  70     /**
  71      * The first number in the range of ids used for component events.
  72      */
  73     public static final int COMPONENT_FIRST             = 100;
  74 
  75     /**
  76      * The last number in the range of ids used for component events.
  77      */
  78     public static final int COMPONENT_LAST              = 103;
  79 
  80    /**
  81      * This event indicates that the component's position changed.
  82      */
  83     @Native public static final int COMPONENT_MOVED     = COMPONENT_FIRST;