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

Print this page




  35  * Container events are provided for notification purposes ONLY;
  36  * The AWT will automatically handle changes to the containers
  37  * contents internally so that the program works properly regardless of
  38  * whether the program is receiving these events or not.
  39  * <P>
  40  * This low-level event is generated by a container object (such as a
  41  * Panel) when a component is added to it or removed from it.
  42  * The event is passed to every <code>ContainerListener</code>
  43  * or <code>ContainerAdapter</code> object which registered to receive such
  44  * events using the component's <code>addContainerListener</code> method.
  45  * (<code>ContainerAdapter</code> objects implement the
  46  * <code>ContainerListener</code> interface.) Each such listener object
  47  * gets this <code>ContainerEvent</code> when the event occurs.
  48  * <p>
  49  * An unspecified behavior will be caused if the {@code id} parameter
  50  * of any particular {@code ContainerEvent} instance is not
  51  * in the range from {@code CONTAINER_FIRST} to {@code CONTAINER_LAST}.
  52  *
  53  * @see ContainerAdapter
  54  * @see ContainerListener
  55  * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
  56  *
  57  * @author Tim Prinzing
  58  * @author Amy Fowler
  59  * @since 1.1
  60  */
  61 public class ContainerEvent extends ComponentEvent {
  62 
  63     /**
  64      * The first number in the range of ids used for container events.
  65      */
  66     public static final int CONTAINER_FIRST             = 300;
  67 
  68     /**
  69      * The last number in the range of ids used for container events.
  70      */
  71     public static final int CONTAINER_LAST              = 301;
  72 
  73    /**
  74      * This event indicates that a component was added to the container.
  75      */




  35  * Container events are provided for notification purposes ONLY;
  36  * The AWT will automatically handle changes to the containers
  37  * contents internally so that the program works properly regardless of
  38  * whether the program is receiving these events or not.
  39  * <P>
  40  * This low-level event is generated by a container object (such as a
  41  * Panel) when a component is added to it or removed from it.
  42  * The event is passed to every <code>ContainerListener</code>
  43  * or <code>ContainerAdapter</code> object which registered to receive such
  44  * events using the component's <code>addContainerListener</code> method.
  45  * (<code>ContainerAdapter</code> objects implement the
  46  * <code>ContainerListener</code> interface.) Each such listener object
  47  * gets this <code>ContainerEvent</code> when the event occurs.
  48  * <p>
  49  * An unspecified behavior will be caused if the {@code id} parameter
  50  * of any particular {@code ContainerEvent} instance is not
  51  * in the range from {@code CONTAINER_FIRST} to {@code CONTAINER_LAST}.
  52  *
  53  * @see ContainerAdapter
  54  * @see ContainerListener
  55  * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/containerlistener.html">Tutorial: Writing a Container Listener</a>
  56  *
  57  * @author Tim Prinzing
  58  * @author Amy Fowler
  59  * @since 1.1
  60  */
  61 public class ContainerEvent extends ComponentEvent {
  62 
  63     /**
  64      * The first number in the range of ids used for container events.
  65      */
  66     public static final int CONTAINER_FIRST             = 300;
  67 
  68     /**
  69      * The last number in the range of ids used for container events.
  70      */
  71     public static final int CONTAINER_LAST              = 301;
  72 
  73    /**
  74      * This event indicates that a component was added to the container.
  75      */