Code example for AncestorEvent

Methods: getComponent

0
  } 
 
   
  class ViewAncestorListener implements AncestorListener {
      public void ancestorAdded(AncestorEvent ancestorEvent) {
        DockView v = (DockView)ancestorEvent.getComponent();
        Container parent = v.getParent();
        if (parent instanceof TabbedDockableContainer){
          installTabbedDockableBorder(v);
        } else if (parent instanceof SplitContainer){
          installSingleDockableBorder(v);
        } else { 
          installMaximizedDockableBorder(v);
        } 
      } 
      public void ancestorMoved(AncestorEvent ancestorEvent) {  }
      public void ancestorRemoved(AncestorEvent ancestorEvent) { }
  }