singleViewDesktop.setPreferredSize( new Dimension(childViewBounds.width, childViewBounds.height) ); child.setLocation(2, 2); child.setSize(child.getPreferredSize());
singleViewDesktop.setPreferredSize(child.getPreferredSize());
    void setChildView(Component child)    {        Component oldChild = getChildView();        if (oldChild != null) {  //Return it to the internal desktop.            singleViewDesktop.remove(oldChild);            desktopPane.add(oldChild);            oldChild.setBounds(childViewBounds);            if (oldChild instanceof TinyFrame) {                TinyFrame tf = (TinyFrame) oldChild;                tf.setTitleBarType(childViewTitleBarType);                tf.setCollapsed(childViewCollapsed);                if (child == null) setParentSizeForMultiView(tf.getParent());            }        }        if (isChild(child)) {  //We've got a new child to display.            desktopPane.remove(child);            singleViewDesktop.add(child);            childViewBounds = child.getBounds();            singleViewDesktop.setPreferredSize(                    new Dimension(childViewBounds.width, childViewBounds.height)                    );            child.setLocation(2, 2);            child.setSize(child.getPreferredSize());                        if (child instanceof TinyFrame) {                TinyFrame tf = (TinyFrame) child;                childViewTitleBarType = tf.getTitleBarType();                childViewCollapsed = tf.isCollapsed();                tf.setTitleBarType(TinyFrame.HEADER_BAR);                tf.setCollapsed(false);                setParentSizeForSingleView(tf.getParent());            }        }        contentPane.validate();        contentPane.repaint();    }