public class AncestorEvent extends AWTEvent
 警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4版本开始,支持所有JavaBeans的长期存储已经添加到java.beans包中。 请参阅XMLEncoder 。 
| Modifier and Type | Field and Description | 
|---|---|
| static int | ANCESTOR_ADDED
              祖先组件被添加到可见对象的层次结构(可见)中,并且正在显示。 
             | 
| static int | ANCESTOR_MOVED
              祖先组件更改了屏幕上的位置。 
             | 
| static int | ANCESTOR_REMOVED
              祖先组件从可见对象(隐藏)的层次结构中删除,不再显示。 
             | 
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASKsource| Constructor and Description | 
|---|
| AncestorEvent(JComponent source, int id, Container ancestor, Container ancestorParent)
              构造一个AncestorEvent对象,以识别祖先组件的显示状态的变化。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| Container | getAncestor()
              返回事件实际发生的祖先。 
             | 
| Container | getAncestorParent()
              返回事件实际发生的祖先的父级。 
             | 
| JComponent | getComponent()
              返回侦听器添加到的组件。 
             | 
consume, getID, isConsumed, paramString, setSource, toStringgetSourcepublic static final int ANCESTOR_ADDED
public static final int ANCESTOR_REMOVED
public static final int ANCESTOR_MOVED
public AncestorEvent(JComponent source, int id, Container ancestor, Container ancestorParent)
source - 发起事件的JComponent(通常为 
            this ) 
           id -一个int,指定 
            ANCESTOR_ADDED , 
            ANCESTOR_REMOVED或 
            ANCESTOR_MOVED 
           ancestor - 指定显示状态更改的祖先组件的Container对象 
           ancestorParent - 指定祖先父项的Container对象 
           public Container getAncestor()
public Container getAncestorParent()
public JComponent getComponent()
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.