Java JPanel Child wrapInMinimizer(JPanel panel)

Here you can find the source of wrapInMinimizer(JPanel panel)

Description

wrap In Minimizer

License

Open Source License

Return

a new panel whose layout forces the original panel to shrink in size as much as possible.

Declaration

public static JPanel wrapInMinimizer(JPanel panel) 

Method Source Code

//package com.java2s;
/*/*from   w w  w  .j  av a2 s.co m*/
 * Copyright 2001-2008 Aqris Software AS. All rights reserved.
 * 
 * This program is dual-licensed under both the Common Development
 * and Distribution License ("CDDL") and the GNU General Public
 * License ("GPL"). You may elect to use one or the other of these
 * licenses.
 */

import javax.swing.JPanel;

import java.awt.BorderLayout;

public class Main {
    /**
     * @return a new panel whose layout forces the original panel to shrink in
     *         size as much as possible.
     */
    public static JPanel wrapInMinimizer(JPanel panel) {
        JPanel result = new JPanel();
        result.setLayout(new BorderLayout());
        result.add(panel, BorderLayout.WEST);

        return result;
    }
}

Related

  1. removeComponentFromPanel(Component removeComponent, JPanel fromPanel)
  2. removePanel(JPanel parent, JPanel panel)
  3. resetControlsInAPanel(JPanel panel)
  4. resizeJPanel(JPanel p)
  5. unmaskContainer(JPanel pnl)
  6. wrapMacFancy(JPanel content)