The ComponentEvent class in java Programming


A ComponentEvent  is generated when the size ,position or visibility of a component is changed .There are four types of component events.The ComponentEvent class defines integer constants that can be used to identity them.The constants and their meaning are shown here

COMPONENT_HIDDEN -The component was hidden

COMPONENT_MOVED -The component was moved

COMPONENT_RESIZED -The component was re sized

COMPONENT_SHOWN - The component became visible


ComponentEvent has this constructor

ComponentEvent(Component src,int type)

here src is a reference to the object that generated this event.The type of the events is specified by type
ComponentEvent is the supercladd either directly or indirectly of ContainerEvent ,FocusEvent,KeyEvent,MouseEvent and WindowEvent

getcomponent()

The method returns the component that generated the event .


0 comments:

Post a Comment

 

learn java programming Copyright © 2011-2012 | Powered by appsackel.org