Java Swing Empty Border buildInfoPanelEmptyBorderScroll(final JComponent content)

Here you can find the source of buildInfoPanelEmptyBorderScroll(final JComponent content)

Description

build Info Panel Empty Border Scroll

License

Open Source License

Declaration

public static JComponent buildInfoPanelEmptyBorderScroll(final JComponent content) 

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:/*w w  w .  ja v  a 2  s.  co  m*/
 * Dr. Alexander Kerner - initial API and implementation
 *******************************************************************************/

import java.awt.BorderLayout;

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

import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class Main {
    public static JComponent buildInfoPanelEmptyBorderScroll(final JComponent content) {

        final JPanel result = new JPanel(new BorderLayout());
        result.setBorder(BorderFactory.createEmptyBorder());
        final JScrollPane scroll = new JScrollPane(content);
        result.add(scroll, BorderLayout.CENTER);
        return result;
    }

    public static JComponent buildInfoPanelEmptyBorderScroll(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));
        final JScrollPane scroll = new JScrollPane(content);
        result.add(scroll, BorderLayout.CENTER);
        return result;
    }
}

Related

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