from java.awt import AWTEvent, Component, Container

class AncestorEvent(AWTEvent):
    ANCESTOR_ADDED: int
    ANCESTOR_MOVED: int
    ANCESTOR_REMOVED: int
    def __init__(
        self, source: Component, id: int, ancestor: Container, ancestorParent: Container
    ) -> None: ...
    def getAncestor(self) -> Container: ...
    def getAncestorParent(self) -> Container: ...
    def getComponent(self) -> Component: ...

class AncestorListener:
    def ancestorAdded(self, event: AncestorEvent) -> None: ...
    def ancestorMoved(self, event: AncestorEvent) -> None: ...
    def ancestorRemoved(self, event: AncestorEvent) -> None: ...
