Java Swing Empty Border buildPanelEmptyBorder(final JComponent content, final int top, final int left, final int bottom, final int right)

Here you can find the source of buildPanelEmptyBorder(final JComponent content, final int top, final int left, final int bottom, final int right)

Description

build Panel Empty Border

License

Open Source License

Declaration

public static JComponent buildPanelEmptyBorder(final JComponent content, final int top, final int left,
            final int bottom, final int right) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015, 2017 Lablicate GmbH.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from   www .  jav a 2s. c  o  m
 * Dr. Alexander Kerner - initial API and implementation
 *******************************************************************************/

import java.awt.BorderLayout;

import javax.swing.BorderFactory;
import javax.swing.JComponent;

import javax.swing.JPanel;

public class Main {
    public static JComponent buildPanelEmptyBorder(final JComponent content, final int top, final int left,
            final int bottom, final int right) {

        final JPanel result = new JPanel(new BorderLayout());
        result.setBorder(BorderFactory.createEmptyBorder(top, left, bottom, right));
        result.add(content, BorderLayout.CENTER);
        return result;
    }
}

Related

  1. addEmptyBorder(JComponent c, int i)
  2. addMarginAndBorder(JComponent component, int margin)
  3. blankBorder(int top, int left, int bottom, int right)
  4. borderlessScrollPane(final Component component)
  5. buildInfoPanelEmptyBorderScroll(final JComponent content)
  6. contentPaneBorder(JComponent component)
  7. correctBorder(final JComponent comp)
  8. createEmptyBorder(int size)
  9. createInnerBorder(int size)