javax.swing.event
Class AncestorEvent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject 
      extended by java.awt.AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent 
          extended by javax.swing.event.AncestorEvent
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class AncestorEvent
extends AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent

An event reported to a child component that originated from an ancestor in the component hierarchy.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
Serialized Form

Field Summary
static int ANCESTOR_ADDED sample code for javax.swing.event.AncestorEvent.ANCESTOR_ADDED definition code for javax.swing.event.AncestorEvent.ANCESTOR_ADDED
          An ancestor-component was added to the hierarchy of visible objects (made visible), and is currently being displayed.
static int ANCESTOR_MOVED sample code for javax.swing.event.AncestorEvent.ANCESTOR_MOVED definition code for javax.swing.event.AncestorEvent.ANCESTOR_MOVED
          An ancestor-component changed its position on the screen.
static int ANCESTOR_REMOVED sample code for javax.swing.event.AncestorEvent.ANCESTOR_REMOVED definition code for javax.swing.event.AncestorEvent.ANCESTOR_REMOVED
          An ancestor-component was removed from the hierarchy of visible objects (hidden) and is no longer being displayed.
 
Fields inherited from class java.awt.AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent
ACTION_EVENT_MASK sample code for java.awt.AWTEvent.ACTION_EVENT_MASK definition code for java.awt.AWTEvent.ACTION_EVENT_MASK , ADJUSTMENT_EVENT_MASK sample code for java.awt.AWTEvent.ADJUSTMENT_EVENT_MASK definition code for java.awt.AWTEvent.ADJUSTMENT_EVENT_MASK , COMPONENT_EVENT_MASK sample code for java.awt.AWTEvent.COMPONENT_EVENT_MASK definition code for java.awt.AWTEvent.COMPONENT_EVENT_MASK , consumed sample code for java.awt.AWTEvent.consumed definition code for java.awt.AWTEvent.consumed , CONTAINER_EVENT_MASK sample code for java.awt.AWTEvent.CONTAINER_EVENT_MASK definition code for java.awt.AWTEvent.CONTAINER_EVENT_MASK , FOCUS_EVENT_MASK sample code for java.awt.AWTEvent.FOCUS_EVENT_MASK definition code for java.awt.AWTEvent.FOCUS_EVENT_MASK , HIERARCHY_BOUNDS_EVENT_MASK sample code for java.awt.AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK definition code for java.awt.AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK , HIERARCHY_EVENT_MASK sample code for java.awt.AWTEvent.HIERARCHY_EVENT_MASK definition code for java.awt.AWTEvent.HIERARCHY_EVENT_MASK , id sample code for java.awt.AWTEvent.id definition code for java.awt.AWTEvent.id , INPUT_METHOD_EVENT_MASK sample code for java.awt.AWTEvent.INPUT_METHOD_EVENT_MASK definition code for java.awt.AWTEvent.INPUT_METHOD_EVENT_MASK , INVOCATION_EVENT_MASK sample code for java.awt.AWTEvent.INVOCATION_EVENT_MASK definition code for java.awt.AWTEvent.INVOCATION_EVENT_MASK , ITEM_EVENT_MASK sample code for java.awt.AWTEvent.ITEM_EVENT_MASK definition code for java.awt.AWTEvent.ITEM_EVENT_MASK , KEY_EVENT_MASK sample code for java.awt.AWTEvent.KEY_EVENT_MASK definition code for java.awt.AWTEvent.KEY_EVENT_MASK , MOUSE_EVENT_MASK sample code for java.awt.AWTEvent.MOUSE_EVENT_MASK definition code for java.awt.AWTEvent.MOUSE_EVENT_MASK , MOUSE_MOTION_EVENT_MASK sample code for java.awt.AWTEvent.MOUSE_MOTION_EVENT_MASK definition code for java.awt.AWTEvent.MOUSE_MOTION_EVENT_MASK , MOUSE_WHEEL_EVENT_MASK sample code for java.awt.AWTEvent.MOUSE_WHEEL_EVENT_MASK definition code for java.awt.AWTEvent.MOUSE_WHEEL_EVENT_MASK , PAINT_EVENT_MASK sample code for java.awt.AWTEvent.PAINT_EVENT_MASK definition code for java.awt.AWTEvent.PAINT_EVENT_MASK , RESERVED_ID_MAX sample code for java.awt.AWTEvent.RESERVED_ID_MAX definition code for java.awt.AWTEvent.RESERVED_ID_MAX , TEXT_EVENT_MASK sample code for java.awt.AWTEvent.TEXT_EVENT_MASK definition code for java.awt.AWTEvent.TEXT_EVENT_MASK , WINDOW_EVENT_MASK sample code for java.awt.AWTEvent.WINDOW_EVENT_MASK definition code for java.awt.AWTEvent.WINDOW_EVENT_MASK , WINDOW_FOCUS_EVENT_MASK sample code for java.awt.AWTEvent.WINDOW_FOCUS_EVENT_MASK definition code for java.awt.AWTEvent.WINDOW_FOCUS_EVENT_MASK , WINDOW_STATE_EVENT_MASK sample code for java.awt.AWTEvent.WINDOW_STATE_EVENT_MASK definition code for java.awt.AWTEvent.WINDOW_STATE_EVENT_MASK
 
Fields inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
source sample code for java.util.EventObject.source definition code for java.util.EventObject.source
 
Constructor Summary
AncestorEvent sample code for javax.swing.event.AncestorEvent.AncestorEvent(javax.swing.JComponent, int, java.awt.Container, java.awt.Container) definition code for javax.swing.event.AncestorEvent.AncestorEvent(javax.swing.JComponent, int, java.awt.Container, java.awt.Container) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  source, int id, Container sample code for java.awt.Container definition code for java.awt.Container  ancestor, Container sample code for java.awt.Container definition code for java.awt.Container  ancestorParent)
          Constructs an AncestorEvent object to identify a change in an ancestor-component's display-status.
 
Method Summary
 Container sample code for java.awt.Container definition code for java.awt.Container getAncestor sample code for javax.swing.event.AncestorEvent.getAncestor() definition code for javax.swing.event.AncestorEvent.getAncestor() ()
          Returns the ancestor that the event actually occurred on.
 Container sample code for java.awt.Container definition code for java.awt.Container getAncestorParent sample code for javax.swing.event.AncestorEvent.getAncestorParent() definition code for javax.swing.event.AncestorEvent.getAncestorParent() ()
          Returns the parent of the ancestor the event actually occurred on.
 JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent getComponent sample code for javax.swing.event.AncestorEvent.getComponent() definition code for javax.swing.event.AncestorEvent.getComponent() ()
          Returns the component that the listener was added to.
 
Methods inherited from class java.awt.AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent
consume sample code for java.awt.AWTEvent.consume() definition code for java.awt.AWTEvent.consume() , getID sample code for java.awt.AWTEvent.getID() definition code for java.awt.AWTEvent.getID() , isConsumed sample code for java.awt.AWTEvent.isConsumed() definition code for java.awt.AWTEvent.isConsumed() , paramString sample code for java.awt.AWTEvent.paramString() definition code for java.awt.AWTEvent.paramString() , setSource sample code for java.awt.AWTEvent.setSource(java.lang.Object) definition code for java.awt.AWTEvent.setSource(java.lang.Object) , toString sample code for java.awt.AWTEvent.toString() definition code for java.awt.AWTEvent.toString()
 
Methods inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
getSource sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

ANCESTOR_ADDED sample code for javax.swing.event.AncestorEvent.ANCESTOR_ADDED

public static final int ANCESTOR_ADDED
An ancestor-component was added to the hierarchy of visible objects (made visible), and is currently being displayed.

See Also:
Constant Field Values

ANCESTOR_REMOVED sample code for javax.swing.event.AncestorEvent.ANCESTOR_REMOVED

public static final int ANCESTOR_REMOVED
An ancestor-component was removed from the hierarchy of visible objects (hidden) and is no longer being displayed.

See Also:
Constant Field Values

ANCESTOR_MOVED sample code for javax.swing.event.AncestorEvent.ANCESTOR_MOVED

public static final int ANCESTOR_MOVED
An ancestor-component changed its position on the screen.

See Also:
Constant Field Values
Constructor Detail

AncestorEvent sample code for javax.swing.event.AncestorEvent(javax.swing.JComponent, int, java.awt.Container, java.awt.Container) definition code for javax.swing.event.AncestorEvent(javax.swing.JComponent, int, java.awt.Container, java.awt.Container)

public AncestorEvent(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  source,
                     int id,
                     Container sample code for java.awt.Container definition code for java.awt.Container  ancestor,
                     Container sample code for java.awt.Container definition code for java.awt.Container  ancestorParent)
Constructs an AncestorEvent object to identify a change in an ancestor-component's display-status.

Parameters:
source - the JComponent that originated the event (typically this)
id - an int specifying ANCESTOR_ADDED sample code for javax.swing.event.AncestorEvent.ANCESTOR_ADDED definition code for javax.swing.event.AncestorEvent.ANCESTOR_ADDED , ANCESTOR_REMOVED sample code for javax.swing.event.AncestorEvent.ANCESTOR_REMOVED definition code for javax.swing.event.AncestorEvent.ANCESTOR_REMOVED or ANCESTOR_MOVED sample code for javax.swing.event.AncestorEvent.ANCESTOR_MOVED definition code for javax.swing.event.AncestorEvent.ANCESTOR_MOVED
ancestor - a Container object specifying the ancestor-component whose display-status changed
ancestorParent - a Container object specifying the ancestor's parent
Method Detail

getAncestor sample code for javax.swing.event.AncestorEvent.getAncestor() definition code for javax.swing.event.AncestorEvent.getAncestor()

public Container sample code for java.awt.Container definition code for java.awt.Container  getAncestor()
Returns the ancestor that the event actually occurred on.


getAncestorParent sample code for javax.swing.event.AncestorEvent.getAncestorParent() definition code for javax.swing.event.AncestorEvent.getAncestorParent()

public Container sample code for java.awt.Container definition code for java.awt.Container  getAncestorParent()
Returns the parent of the ancestor the event actually occurred on. This is most interesting in an ANCESTOR_REMOVED event, as the ancestor may no longer be in the component hierarchy.


getComponent sample code for javax.swing.event.AncestorEvent.getComponent() definition code for javax.swing.event.AncestorEvent.getComponent()

public JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  getComponent()
Returns the component that the listener was added to.