AWT Event Classes-AWT ContainerEvent Class - AWT (Abstract Window Toolkit)

What is the use of AWT ContainerEvent Class?

Introduction

ContainerEvent class represents that a container's contents changed because a component was added or removed.

Class declaration

Below is the declaration for java.awt.event.ContainerEvent class:

Field

Below are the fields for java.awt.Component class:

  • static int COMPONENT_ADDED -- This event indicates that a component was added to the container.
  • static int COMPONENT_REMOVED -- This event indicates that a component was removed from the container.
  • static int CONTAINER_FIRST -- The first number in the range of ids used for container events.
  • static int CONTAINER_LAST -- The last number in the range of ids used for container events.

Class constructors

S.N.

Constructor & Description

1

ContainerEvent(Component source, int id, Component child)

Constructs a ContainerEvent object.

Class methods

S.N.

Method & Description

1

Component getChild()
Returns the component that was affected by the event.

2

Container getContainer()
Returns the originator of the event.

3

String paramString()
Returns a parameter string identifying this event.

Methods inherited

This class inherits methods from the following classes:

  • java.awt.ComponentEvent
  • java.awt.AWTEvent
  • java.util.EventObject
  • java.lang.Object

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

AWT (Abstract Window Toolkit) Topics