Java Swing BorderLayout layoutCompactVertical(JComponent... list)

Here you can find the source of layoutCompactVertical(JComponent... list)

Description

layout Compact Vertical

License

BSD License

Declaration

public static JComponent layoutCompactVertical(JComponent... list) 

Method Source Code

//package com.java2s;
/***//from   ww w .  j ava 2  s.c o  m
 * Copyright (C) 2010 Johan Henriksson
 * This code is under the Endrov / BSD license. See www.endrov.net
 * for the full text and how to cite.
 */

import java.awt.BorderLayout;

import javax.swing.*;

public class Main {
    public static JComponent layoutCompactVertical(JComponent... list) {
        JComponent last = list[list.length - 1];
        for (int i = list.length - 2; i >= 0; i--) {
            JPanel p = new JPanel(new BorderLayout());
            p.add(list[i], BorderLayout.NORTH);
            p.add(last, BorderLayout.SOUTH);
            last = p;
        }
        return last;
        /*      JPanel p=new JPanel(new BorderLayout());
         p.add(left,BorderLayout.WEST);
         p.add(right,BorderLayout.EAST);
         return p;*/
    }
}

Related

  1. createBorderLayoutPane(Object... args)
  2. createBox(Border border, Component center, Component north)
  3. createPanel(Component comp, boolean setBorder, int borderType)
  4. createPanel(JComponent centerComponent, JComponent placedComponent, String borderLayoutConstraint)
  5. layoutCompactHorizontal(JComponent... list)
  6. makeBorderPanel(int topMargin, int leftMargin, int bottomMargin, int rightMargin)
  7. makeLateralBorders(JPanel panel, Dimension reference, Border style)
  8. wrapInBorderPanel(final JComponent component)
  9. wrapWithBorder(JComponent aPanel, Border aBorder)