java.awt.event
Interface ComponentListener

All Superinterfaces:
EventListener sample code for java.util.EventListener definition code for java.util.EventListener
All Known Implementing Classes:
AWTEventMulticaster sample code for java.awt.AWTEventMulticaster definition code for java.awt.AWTEventMulticaster , BasicInternalFrameUI.ComponentHandler sample code for javax.swing.plaf.basic.BasicInternalFrameUI.ComponentHandler definition code for javax.swing.plaf.basic.BasicInternalFrameUI.ComponentHandler , BasicSliderUI.ComponentHandler sample code for javax.swing.plaf.basic.BasicSliderUI.ComponentHandler definition code for javax.swing.plaf.basic.BasicSliderUI.ComponentHandler , BasicTreeUI.ComponentHandler sample code for javax.swing.plaf.basic.BasicTreeUI.ComponentHandler definition code for javax.swing.plaf.basic.BasicTreeUI.ComponentHandler , Component.AccessibleAWTComponent.AccessibleAWTComponentHandler sample code for java.awt.Component.AccessibleAWTComponent.AccessibleAWTComponentHandler definition code for java.awt.Component.AccessibleAWTComponent.AccessibleAWTComponentHandler , ComponentAdapter sample code for java.awt.event.ComponentAdapter definition code for java.awt.event.ComponentAdapter , JViewport.ViewListener sample code for javax.swing.JViewport.ViewListener definition code for javax.swing.JViewport.ViewListener

public interface ComponentListener
extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener

The listener interface for receiving component events. The class that is interested in processing a component event either implements this interface (and all the methods it contains) or extends the abstract ComponentAdapter class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component's addComponentListener method. When the component's size, location, or visibility changes, the relevant method in the listener object is invoked, and the ComponentEvent is passed to it.

Component events are provided for notification purposes ONLY; The AWT will automatically handle component moves and resizes internally so that GUI layout works properly regardless of whether a program registers a ComponentListener or not.

Since:
1.1
See Also:
ComponentAdapter sample code for java.awt.event.ComponentAdapter definition code for java.awt.event.ComponentAdapter , ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent , Tutorial: Writing a Component Listener, Reference: The Java Class Libraries (update file)

Method Summary
 void componentHidden sample code for java.awt.event.ComponentListener.componentHidden(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentHidden(java.awt.event.ComponentEvent) (ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
          Invoked when the component has been made invisible.
 void componentMoved sample code for java.awt.event.ComponentListener.componentMoved(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentMoved(java.awt.event.ComponentEvent) (ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
          Invoked when the component's position changes.
 void componentResized sample code for java.awt.event.ComponentListener.componentResized(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentResized(java.awt.event.ComponentEvent) (ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
          Invoked when the component's size changes.
 void componentShown sample code for java.awt.event.ComponentListener.componentShown(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentShown(java.awt.event.ComponentEvent) (ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
          Invoked when the component has been made visible.
 

Method Detail

componentResized sample code for java.awt.event.ComponentListener.componentResized(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentResized(java.awt.event.ComponentEvent)

void componentResized(ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
Invoked when the component's size changes.


componentMoved sample code for java.awt.event.ComponentListener.componentMoved(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentMoved(java.awt.event.ComponentEvent)

void componentMoved(ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
Invoked when the component's position changes.


componentShown sample code for java.awt.event.ComponentListener.componentShown(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentShown(java.awt.event.ComponentEvent)

void componentShown(ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
Invoked when the component has been made visible.


componentHidden sample code for java.awt.event.ComponentListener.componentHidden(java.awt.event.ComponentEvent) definition code for java.awt.event.ComponentListener.componentHidden(java.awt.event.ComponentEvent)

void componentHidden(ComponentEvent sample code for java.awt.event.ComponentEvent definition code for java.awt.event.ComponentEvent  e)
Invoked when the component has been made invisible.