Example usage for java.awt Container remove

List of usage examples for java.awt Container remove

Introduction

In this page you can find the example usage for java.awt Container remove.

Prototype

public void remove(Component comp) 

Source Link

Document

Removes the specified component from this container.

Usage

From source file:org.xulux.swing.widgets.Window.java

/**
 * @see org.xulux.gui.Widget#destroy()//from ww  w. j a  va  2s.  c o  m
 */
public void destroy() {
    super.destroy();
    if (window != null) {
        window.removeAll();
        window.removeWindowListener(windowListener);
        windowListener = null;
        window.setVisible(false);
        Container container = window.getParent();
        if (container != null) {
            container.remove(window);
        }
        window.dispose();
        window = null;
    }
}

From source file:org.zaproxy.zap.extension.quickstart.ExtensionQuickStart.java

public void showOnStart(boolean showOnStart) {
    if (!showOnStart) {
        // Remove the tab right away
        Container parent = this.getQuickStartPanel().getParent();
        parent.remove(this.getQuickStartPanel());
    }//from   w  w w . ja v  a  2  s .co m

    // Save in configs
    ExtensionExtension extExt = (ExtensionExtension) Control.getSingleton().getExtensionLoader()
            .getExtension(ExtensionExtension.NAME);
    if (extExt != null) {
        extExt.enableExtension(NAME, showOnStart);
    }
}

From source file:plugin.notes.gui.JIcon.java

/**  Delete the file from disk that this icon represents */
private void deleteFile() {
    int choice = JOptionPane.showConfirmDialog(GMGenSystem.inst, "Delete file " + launch.getPath(),
            "Delete File?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

    if (choice == JOptionPane.YES_OPTION) {
        try {/*from  w w  w. j  a v a2 s. c o  m*/
            launch.delete();

            Container cnt = getParent();
            cnt.remove(this);

            if (cnt instanceof JComponent) {
                JComponent comp = (JComponent) cnt;
                comp.updateUI();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

From source file:pt.lsts.neptus.plugins.sunfish.awareness.SituationAwareness.java

@Override
public void setActive(boolean mode, StateRenderer2D source) {
    super.setActive(mode, source);
    Container parent = source.getParent();
    while (parent != null && !(parent.getLayout() instanceof BorderLayout))
        parent = parent.getParent();/*from  w  w  w  .  j av a  2s. c om*/
    if (mode) {
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(slider, BorderLayout.CENTER);
        panel.add(minTimeLabel, BorderLayout.WEST);
        panel.add(maxTimeLabel, BorderLayout.EAST);
        parent.add(panel, BorderLayout.SOUTH);
    } else {
        parent = slider.getParent().getParent();
        parent.remove(slider.getParent());
    }
    parent.invalidate();
    parent.validate();
    parent.repaint();

}

From source file:tufts.vue.RichTextBox.java

private Container removeAsEdit() {
    Container parent = getParent();
    if (parent != null)
        parent.remove(this);
    else/*from w  w w .j a  v a  2 s.c o m*/
        out("FAILED TO FIND PARENT ATTEMPTING TO REMOVE SELF");
    return parent;
}