AncestorEventpublic class AncestorEvent extends 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 {@link java.beans.XMLEncoder}. |
Fields Summary |
---|
public static final int | ANCESTOR_ADDEDAn ancestor-component was added to the hierarchy of
visible objects (made visible), and is currently being displayed. | public static final int | ANCESTOR_REMOVEDAn ancestor-component was removed from the hierarchy
of visible objects (hidden) and is no longer being displayed. | public static final int | ANCESTOR_MOVEDAn ancestor-component changed its position on the screen. | Container | ancestor | Container | ancestorParent |
Constructors Summary |
---|
public AncestorEvent(JComponent source, int id, Container ancestor, Container ancestorParent)Constructs an AncestorEvent object to identify a change
in an ancestor-component's display-status.
super(source, id);
this.ancestor = ancestor;
this.ancestorParent = ancestorParent;
|
Methods Summary |
---|
public java.awt.Container | getAncestor()Returns the ancestor that the event actually occurred on.
return ancestor;
| public 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.
return ancestorParent;
| public javax.swing.JComponent | getComponent()Returns the component that the listener was added to.
return (JComponent)getSource();
|
|