List of usage examples for java.awt Component.Container remove
@SuppressWarnings("unchecked") public void remove(MenuComponent popup)
From source file:com.haulmont.cuba.desktop.sys.DesktopWindowManager.java
@Override protected void showFrame(Component parent, Frame frame) { // the same as web window manager does if (parent instanceof Component.Container) { Component.Container container = (Component.Container) parent; for (Component c : container.getComponents()) { if (c instanceof Component.Disposable) { Component.Disposable disposable = (Component.Disposable) c; if (!disposable.isDisposed()) { disposable.dispose(); }// ww w . j av a2 s .c o m } container.remove(c); } container.add(frame); } else { throw new IllegalStateException( "Parent component must be com.haulmont.cuba.gui.components.Component.Container"); } }