Java Swing TitledBorder buildInfoPanelTextBorderScroll(final JComponent content, final String title)

Here you can find the source of buildInfoPanelTextBorderScroll(final JComponent content, final String title)

Description

build Info Panel Text Border Scroll

License

Open Source License

Declaration

public static JComponent buildInfoPanelTextBorderScroll(final JComponent content, final String title) 

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://ww w . ja v a 2s . c  om
 * 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 buildInfoPanelTextBorderScroll(final JComponent content, final String title) {

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

Related

  1. addMarginBorder(JPanel panel, String title, int top, int left, int bottom, int right)
  2. borderTitle(JComponent component, String title)
  3. buildInfoPanelTextBorder(final JLabel content, final String title)
  4. buildLabeledBorder(String label)
  5. createBorder()
  6. createBorder(String message)
  7. createBorder(String title)