Example usage for javax.swing JComponent getComponents

List of usage examples for javax.swing JComponent getComponents

Introduction

In this page you can find the example usage for javax.swing JComponent getComponents.

Prototype

public Component[] getComponents() 

Source Link

Document

Gets all the components in this container.

Usage

From source file:org.nuclos.client.genericobject.GenericObjectCollectController.java

private void searchTabbedPanes(JComponent comp, List<JTabbedPane> lst) {
    if (comp instanceof JTabbedPane)
        lst.add((JTabbedPane) comp);
    if (comp.getComponents().length == 0)
        return;//from   ww w.  j a va2 s .  co m
    for (Component c : comp.getComponents())
        if (c instanceof JComponent)
            searchTabbedPanes((JComponent) c, lst);
}

From source file:org.nuclos.client.genericobject.GenericObjectCollectController.java

private void collectComponents(JComponent comp, List<JComponent> lst) {
    for (Component c : comp.getComponents())
        if (c instanceof JComponent) {
            JComponent jc = (JComponent) c;
            if (jc.getComponentCount() == 0)
                lst.add(jc);//w  w w  .jav a 2 s. co m
            if (jc instanceof LabeledComponent) {
                lst.add(jc);
                continue;
            }
            collectComponents(jc, lst);
        }
}

From source file:org.nuxeo.launcher.gui.NuxeoFrame.java

public void debug(JComponent parent) {
    for (Component comp : parent.getComponents()) {
        if (comp instanceof JComponent) {
            ((JComponent) comp).setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createLineBorder(Color.red), ((JComponent) comp).getBorder()));
            log.info(comp.getClass() + " size: " + ((JComponent) comp).getSize());
        }//w  ww  . j  a  v a  2 s.  co m
    }
}

From source file:org.openmicroscopy.shoola.agents.util.ui.ScriptComponent.java

/** 
 * Iterates through the components and sets the background color.
 * // w  ww . j  a  v  a  2 s.co  m
 * @param c The component to handle
 * @param background The color to set.
 */
private void setComponentColor(JComponent c, Color background) {
    c.setBackground(background);
    if (c.getComponentCount() > 0) {
        Component[] components = c.getComponents();
        for (int i = 0; i < components.length; i++) {
            if (components[i] instanceof JComponent) {
                setComponentColor((JComponent) components[i], background);
            }
        }
    }
}

From source file:org.pentaho.reporting.engine.classic.core.util.ComponentDrawable.java

/**
 * Prepares the component for drawing. This recursively disables the double-buffering as this would interfere with the
 * drawing./*ww w .j av a 2 s .  c  om*/
 *
 * @param c
 *          the component that should be prepared.
 */
private void prepareComponent(final Component c) {
    if (c instanceof JComponent) {
        final JComponent jc = (JComponent) c;
        jc.setDoubleBuffered(false);
        final Component[] childs = jc.getComponents();
        for (int i = 0; i < childs.length; i++) {
            final Component child = childs[i];
            prepareComponent(child);
        }
    }
}