Java Code Examples for javax.swing.JComponent.addAncestorListener()

The following are Jave code examples for showing how to use addAncestorListener() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: RxJava2Swing   File: AncestorEventObservable.java   View Source Code Vote up 5 votes
@Override
protected void subscribeActual(Observer<? super AncestorEvent> observer) {
    JComponent w = widget;

    AncestorEventConsumer aec = new AncestorEventConsumer(observer, w);
    observer.onSubscribe(aec);

    w.addAncestorListener(aec);
    if (aec.get() == null) {
        aec.onDispose(w);
    }
}