Java Swing BorderLayout addToVerticalBorderLayout(JComponent north, JComponent center, JComponent south)

Here you can find the source of addToVerticalBorderLayout(JComponent north, JComponent center, JComponent south)

Description

add To Vertical Border Layout

License

Apache License

Declaration

public static JPanel addToVerticalBorderLayout(JComponent north, JComponent center, JComponent south) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.BorderLayout;

import javax.swing.JComponent;
import javax.swing.JPanel;

public class Main {
    public static JPanel addToVerticalBorderLayout(JComponent north, JComponent center, JComponent south) {
        JPanel panel = new JPanel(new BorderLayout());

        if (north != null) {
            panel.add(north, BorderLayout.NORTH);
        }// w w  w .j  av a  2  s .c  o m

        if (center != null) {
            panel.add(center, BorderLayout.CENTER);
        }

        if (south != null) {
            panel.add(south, BorderLayout.SOUTH);
        }

        return panel;
    }
}

Related

  1. addBorders(Component content)
  2. addToPanel(JPanel panel, JComponent centerComponent, JComponent arrangedComponent, String borderLayoutConstraint)
  3. createBorderLayoutPane(Object... args)
  4. createBox(Border border, Component center, Component north)
  5. createPanel(Component comp, boolean setBorder, int borderType)
  6. createPanel(JComponent centerComponent, JComponent placedComponent, String borderLayoutConstraint)