Add <code>box</code> to the container and sets the parent correctly. If <code>box</code> is <code>null</code>
nochange will be performed and no error thrown.

@param box will be added to the container
422538
public void addBox(Box box) {
        if (box != null) {
            boxes = new ArrayList<Box>(getBoxes());
            boxes.add(box);
        }
    }
1221055
public boolean addSubPanels(Container parent)
    {
        parent.setLayout(new BoxLayout(parent, BoxLayout.X_AXIS));
        JPanel topScreen = new JPanel();
        topScreen.setOpaque(false);
        topScreen.setLayout(new BoxLayout(topScreen, BoxLayout.Y_AXIS));
        m_taChatDialog = new JTextArea();
        m_taChatDialog.setOpaque(false);
        m_taChatDialog.setBorder(new LineBorder(Color.black));
        topScreen.add(m_taChatDialog);
        
        JPanel panelBottom = new JPanel();
        panelBottom.setOpaque(false);
        topScreen.add(panelBottom);
        
        panelBottom.setLayout(new BoxLayout(panelBottom, BoxLayout.X_AXIS));
        m_tfTextIn = new JTextField()
        {
            private static final long serialVersionUID = 1L;

            public Dimension getMaximumSize()
            {
                return new Dimension(super.getMaximumSize().width, this.getPreferredSize().height);
            }
        };
        panelBottom.add(m_tfTextIn);
        ImageIcon icon = this.getBaseApplet().loadImageIcon(SEND);
        String strText = this.getBaseApplet().getString(SEND);
        JButton button = new JButton(strText, icon);
        button.setOpaque(false);
        button.setName(SEND);
        panelBottom.add(button);
        button.addActionListener(this);
        
//        JScrollPane scrollpane = new JScrollPane(thinscreen);
        parent.add(topScreen);
        return true;
    }
229822
public static void dumpBox(Container box) {
        log.debug("Dump box: {}", box);
        for (Box bx : box.getBoxes()) {
            log.debug("{} child: {}", box, bx.getType());
        }
    }
1323106
protected void setEmailBox() {

        m_sendEmail.setEnabled(
            !CmsStringUtil.isEmptyOrWhitespaceOnly(m_pw.getPassword1())
                | !CmsStringUtil.isEmptyOrWhitespaceOnly(m_pw.getPassword2()));
    }
1254668
public void setBoundingBox(BoundingBox boundingBox) {
		setMinX(boundingBox.getMinLongitude());
		setMaxX(boundingBox.getMaxLongitude());
		setMinY(boundingBox.getMinLatitude());
		setMaxY(boundingBox.getMaxLatitude());
	}
198766
@Override
	public void layoutContainer(Container parent) {
		synchronized (parent.getTreeLock()) {
			Insets insets=parent.getInsets();
			int ncomponents=parent.getComponentCount();
			if(ncomponents==0) return;

			int nrows=rows;
			int ncols=columns;
			if(nrows>0) {
				ncols=((ncomponents/2)+nrows-1)/nrows;
			} else {
				nrows=((ncomponents/2)+ncols-1)/ncols;
			}

			// Determine the desired widths for the labels
			int[] labelWidths=new int[ncols];
			int pos=0;
		Loop1:
			for(int y=0;y<nrows;y++) {
				for(int x=0;x<ncols;x++) {
					if(pos>=ncomponents) break Loop1;
					Component component=parent.getComponent(pos);
					pos+=2;
					Dimension d=component.getPreferredSize();
					if(d.width>labelWidths[x]) labelWidths[x]=d.width;
				}
			}
			Dimension parentSize=parent.getSize();
			int width=parentSize.width-(insets.left+insets.right);
			int height=parentSize.height-(insets.top+insets.bottom);
			int lasty=0;
			pos=0;
		Loop:
			for(int y=0;y<nrows;y++) {
				int yend=0;
				int cellHeight=0;
				if (stretchComponents) {
					yend=((y+1)*(height+vgap))/nrows-vgap;
					cellHeight=yend-lasty;
				}
				int lastx=0;
				for(int x=0;x<ncols;x++) {
					if(pos>=ncomponents) break Loop;
					int xend=((x+1)*(width+hgap))/ncols-hgap;
					int cellWidth=xend-lastx;
					// Split this width into two areas, left for label and right for component
					int availableWidth=labelWidths[x];
					if(availableWidth>cellWidth) availableWidth=cellWidth;
					// Reshape the label to fit
					Component label=parent.getComponent(pos++);
					Dimension labelD=label.getPreferredSize();
					Component component=parent.getComponent(pos++);
					Dimension componentD=component.getPreferredSize();
					if (!stretchComponents) {
						cellHeight = Math.max(labelD.height, componentD.height);
						if((lasty+cellHeight)>yend) yend=lasty+cellHeight;
						// yend = lasty+cellHeight;
					}

					//int actualWidth=labelD.width;
					//if(actualWidth>availableWidth) actualWidth=availableWidth;
					label.setBounds(
						lastx+insets.left,
						lasty+insets.top,
						availableWidth,
						cellHeight
					);
					// Split out the right area
					if(pos>ncomponents) break Loop;
					availableWidth=cellWidth-cgap-labelWidths[x];
					if(availableWidth<0) availableWidth=0;
					// Reshape the component
					int actualWidth=componentD.width;
					if(actualWidth>availableWidth) actualWidth=availableWidth;
					component.setBounds(
						lastx+labelWidths[x]+cgap+insets.left,
						lasty+insets.top,
						actualWidth,
						cellHeight /*Klay--8/22/01*/
					);
					// Get ready for next iteration
					lastx=xend+hgap;
				}
				lasty=yend+vgap;
			}
		}
	}
547993
public void init(Object parent, Object record)
    {
        super.init(parent, record);
        this.setOpaque(false);
        this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        this.addButtons();
    }
399901
@UiChild(limit = 1, tagname = "valuebox")
	public void setValueBox(ValueBoxBase<T> widget) {
		contents.add(widget);
		setEditor(widget.asEditor());
	}
740642
public boolean changeSubScreen(Container parent, JBasePanel baseScreen, String strCommandToPush, int options)
    {
        if ((parent == null) || (parent == this))
            parent = m_parent;
        boolean bScreenChange = false;
        if (!this.checkSecurity(baseScreen))
        {
            baseScreen.free();
            return false;
        }
        this.freeSubComponents(parent);
        if (parent.getComponentCount() > 0)
        { // Remove all the old components
            parent.removeAll();
            bScreenChange = true;
        }
        JComponent screen = baseScreen;
        if (!(parent.getLayout() instanceof BoxLayout))
            parent.setLayout(new BorderLayout());   // If default layout, use box layout!

        screen = baseScreen.setupNewScreen(baseScreen);

        screen.setMinimumSize(new Dimension(100, 100));
        screen.setAlignmentX(LEFT_ALIGNMENT);
        screen.setAlignmentY(TOP_ALIGNMENT);
        parent.add(screen);
        
        if (bScreenChange)
        {
            this.invalidate();
            this.validate();
            this.repaint();
            baseScreen.resetFocus();
        }
        if (parent == m_parent)
        {
            if (strCommandToPush == null)
                strCommandToPush = baseScreen.getScreenCommand();
            if (strCommandToPush != null)
                if ((options & Constants.DONT_PUSH_HISTORY) == 0)
                    this.pushHistory(strCommandToPush, ((options & Constants.DONT_PUSH_TO_BROWSER) == Constants.PUSH_TO_BROWSER));
        }
        
        return true;    // Success
    }
1179297
public void setParent( IVarDef parent)
    {
    parent_ = parent;
    pathName_ = null;
    effCondition_ = null;
    position_ = null;
    }
432473
public void setContainer(final String container) {
        if (container != null)
            attrMixin.setAttribute(CONTAINER, container);
        else
            attrMixin.removeAttribute(CONTAINER);
    }
821103
public void init(Object parent, Object record)
    {
        super.init(parent, record);
        record = this.getFieldList();   // Created/set in JBaseScreen.init
        this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        FieldTable table = ((FieldList)record).getTable();
        CalendarModel model = this.getCalendarModel(table);
        ImageIcon backgroundImage = null;
        if (this.getBaseApplet() != null)
        	backgroundImage = this.getBaseApplet().getBackgroundImage();	// Calendar panel is transparent, but this helps with rendering see-thru components 
        CalendarPanel panel = new CalendarPanel(model, true, backgroundImage);
        this.add(panel);
    }
317392
public void addChildComponent(final WicketField<?> parent)
	{
		if ((parent.getChildren() != null) && !parent.getChildren().isEmpty())
		{
			for (final SimpleTag iterable_element : parent.getChildren())
			{
				final WicketField<?> field = (WicketField<?>)iterable_element;
				final Component c = parent.getComponent();
				if (c instanceof MarkupContainer)
				{
					final MarkupContainer mc = (MarkupContainer)c;
					mc.add(field.getComponent());
				}
				addChildComponent(field);
			}
		}
	}
714014
public void add(IRenderingElement element) {
        if (element != null) {
            if (element.getClass().equals(ElementGroup.class))
                elements.addAll(((ElementGroup) element).elements);
            else
                elements.add(element);
        }
    }
1202193
public boolean addSubPanels(Container parent, int options)
    {
        if (parent == null)
            parent = m_parent;
        String strScreen = this.getProperty(Params.SCREEN);
        JBasePanel baseScreen = (JBasePanel)ClassServiceUtility.getClassService().makeObjectFromClassName(strScreen);
        if (baseScreen != null)
        {
            FieldList record = null;
            baseScreen.init(this, record);  // test
            return this.changeSubScreen(parent, baseScreen, null, options);   // You must manually push the history command
        }
        else
            Util.getLogger().warning("Screen class not found " + strScreen);
        return false;	// Nothing happened
    }
1180733
protected void setParent(Object parent, Object child) {
        getProxyBuilder().getCurrentFactory().setParent(getProxyBuilder().getChildBuilder(), parent, child);
        Factory parentFactory = getProxyBuilder().getParentFactory();
        if (parentFactory != null) {
            parentFactory.setChild(getProxyBuilder().getCurrentBuilder(), parent, child);
        }
    }
962703
public static <T extends MutableTreeNode<T>> void addChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        parent.addChild(parent.getChildren().size(), child);
    }