Here you can find the source of addToVerticalBorderLayout(JComponent north, JComponent center, JComponent south)
public static JPanel addToVerticalBorderLayout(JComponent north, JComponent center, JComponent south)
//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; } }